class Test : Object {
	public static void main(){
		string keystr = "XF86AudioPlay";

		stdout.printf("sizeof(char) = %lu, sizeof(int) = %lu, sizeof(long) = %lu\n",
			sizeof(char), sizeof(int), sizeof(long));

		stdout.printf("sizeof(X.KeyCode) = %lu, sizeof(X.KeySym) = %lu, sizeof(X.ID) = %lu\n",
			sizeof(X.KeyCode), sizeof(X.KeySym), sizeof(X.ID));

		X.Display display = new X.Display();
		stdout.printf("Display %s opened\n", display.display_string());

		X.KeySym keysym  = X.string_to_keysym(keystr);
		stdout.printf("String %s has keysym 0x%lX\n", keystr, keysym);

		X.KeyCode keycode = display.keysym_to_keycode(keysym);
		stdout.printf("Keysym 0x%lX has keycode %lu\n", keysym, keycode);

		XTest.fake_key_event(display, (int) keycode, true, 0);
		stdout.printf("Keycode %lu pressed\n", keycode);

		XTest.fake_key_event(display, (int) keycode, false, 0);
		stdout.printf("Keycode %lu released\n", keycode);

		display.flush();
		stdout.printf("Display %s flushed\n", display.display_string());
	}
}
