new file mode 100644
@@ -0,0 +1,146 @@
+/*
+ * QEMU System Emulator
+ *
+ * Copyright (c) 2016 John Arbuckle
+ *
+ * This work is licensed under the terms of the GNU GPL, version 2 or later.
+ * See the COPYING file in the top-level directory.
+ */
+
+/*
+ * adb-keys.h
+ *
+ * Provides an enum of all the Macintosh keycodes.
+ * Note: keys like Power, volume related, and eject are handled at a lower
+ * level and are not available to QEMU. That doesn't mean we can't
+ * substitute one key for another. The function keys like F1 make a good
+ * substitute for these keys. This can be done in the GTK, SDL, or Cocoa
+ * code.
+ * Additional information: http://stackoverflow.com/questions/3202629
+ */
+
+#ifndef ADB_KEYS_H
+#define ADB_KEYS_H
+
+enum {
+ ADB_KEY_A = 0,
+ ADB_KEY_B = 11,
+ ADB_KEY_C = 8,
+ ADB_KEY_D = 2,
+ ADB_KEY_E = 14,
+ ADB_KEY_F = 3,
+ ADB_KEY_G = 5,
+ ADB_KEY_H = 4,
+ ADB_KEY_I = 34,
+ ADB_KEY_J = 38,
+ ADB_KEY_K = 40,
+ ADB_KEY_L = 37,
+ ADB_KEY_M = 46,
+ ADB_KEY_N = 45,
+ ADB_KEY_O = 31,
+ ADB_KEY_P = 35,
+ ADB_KEY_Q = 12,
+ ADB_KEY_R = 15,
+ ADB_KEY_S = 1,
+ ADB_KEY_T = 17,
+ ADB_KEY_U = 32,
+ ADB_KEY_V = 9,
+ ADB_KEY_W = 13,
+ ADB_KEY_X = 7,
+ ADB_KEY_Y = 16,
+ ADB_KEY_Z = 6,
+
+ ADB_KEY_0 = 29,
+ ADB_KEY_1 = 18,
+ ADB_KEY_2 = 19,
+ ADB_KEY_3 = 20,
+ ADB_KEY_4 = 21,
+ ADB_KEY_5 = 23,
+ ADB_KEY_6 = 22,
+ ADB_KEY_7 = 26,
+ ADB_KEY_8 = 28,
+ ADB_KEY_9 = 25,
+
+ ADB_KEY_GRAVE_ACCENT = 50,
+ ADB_KEY_MINUS = 27,
+ ADB_KEY_EQUAL = 24,
+ ADB_KEY_DELETE = 51,
+ ADB_KEY_CAPS_LOCK = 57,
+ ADB_KEY_TAB = 48,
+ ADB_KEY_RETURN = 36,
+ ADB_KEY_LEFT_BRACKET = 33,
+ ADB_KEY_RIGHT_BRACKET = 30,
+ ADB_KEY_BACKSLASH = 42,
+ ADB_KEY_SEMICOLON = 41,
+ ADB_KEY_APOSTROPHE = 39,
+ ADB_KEY_COMMA = 43,
+ ADB_KEY_PERIOD = 47,
+ ADB_KEY_FORWARD_SLASH = 44,
+ ADB_KEY_LEFT_SHIFT = 56,
+ ADB_KEY_RIGHT_SHIFT = 60,
+ ADB_KEY_SPACEBAR = 49,
+ ADB_KEY_LEFT_CONTROL = 59,
+ ADB_KEY_RIGHT_CONTROL = 62,
+ ADB_KEY_LEFT_OPTION = 58,
+ ADB_KEY_RIGHT_OPTION = 61,
+ ADB_KEY_LEFT_COMMAND = 55,
+ ADB_KEY_RIGHT_COMMAND = 54,
+
+ ADB_KEY_KP_0 = 82,
+ ADB_KEY_KP_1 = 83,
+ ADB_KEY_KP_2 = 84,
+ ADB_KEY_KP_3 = 85,
+ ADB_KEY_KP_4 = 86,
+ ADB_KEY_KP_5 = 87,
+ ADB_KEY_KP_6 = 88,
+ ADB_KEY_KP_7 = 89,
+ ADB_KEY_KP_8 = 91,
+ ADB_KEY_KP_9 = 92,
+ ADB_KEY_KP_PERIOD = 65,
+ ADB_KEY_KP_ENTER = 76,
+ ADB_KEY_KP_PLUS = 69,
+ ADB_KEY_KP_SUBTRACT = 78,
+ ADB_KEY_KP_MULTIPLY = 67,
+ ADB_KEY_KP_DIVIDE = 75,
+ ADB_KEY_KP_EQUAL = 81,
+ ADB_KEY_KP_CLEAR = 71,
+
+ ADB_KEY_UP = 126,
+ ADB_KEY_DOWN = 125,
+ ADB_KEY_LEFT = 123,
+ ADB_KEY_RIGHT = 124,
+
+ ADB_KEY_HELP = 114,
+ ADB_KEY_HOME = 115,
+ ADB_KEY_PAGE_UP = 116,
+ ADB_KEY_PAGE_DOWN = 121,
+ ADB_KEY_END = 119,
+ ADB_KEY_FORWARD_DELETE = 117,
+
+ ADB_KEY_ESC = 53,
+ ADB_KEY_F1 = 122,
+ ADB_KEY_F2 = 120,
+ ADB_KEY_F3 = 99,
+ ADB_KEY_F4 = 118,
+ ADB_KEY_F5 = 96,
+ ADB_KEY_F6 = 97,
+ ADB_KEY_F7 = 98,
+ ADB_KEY_F8 = 100,
+ ADB_KEY_F9 = 101,
+ ADB_KEY_F10 = 109,
+ ADB_KEY_F11 = 103,
+ ADB_KEY_F12 = 111,
+ ADB_KEY_F13 = 105,
+ ADB_KEY_F14 = 107,
+ ADB_KEY_F15 = 113,
+
+ ADB_KEY_VOLUME_UP = 72,
+ ADB_KEY_VOLUME_DOWN = 73,
+ ADB_KEY_VOLUME_MUTE = 74,
+ ADB_KEY_POWER = 32639,
+};
+
+/* Could not find the value for this key. */
+/* #define ADB_KEY_EJECT */
+
+#endif /* ADB_KEYS_H */
This commit implements the adb-keys.h file. It holds information on adb keycode values. Signed-off-by: John Arbuckle <programmingkidx@gmail.com> --- * v4 changes Replaced an 'a' with 'an'. Replaced __ADBKEYS__ with ADB_KEYS_H. Added additional information comment with link. Changed license to GNU GPL v2 or later. * v3 changes Changed name of file from MacKeys.h to adb-keys.h. Changed name of constants from MAC_KEYS_ to ADB_KEYS_. include/hw/input/adb-keys.h | 146 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 146 insertions(+) create mode 100644 include/hw/input/adb-keys.h