ckb-next  v0.2.8 at branch master
ckb-next driver for corsair devices
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
keymap_mac.h
Go to the documentation of this file.
1 #ifndef KEYMAP_MAC_H
2 #define KEYMAP_MAC_H
3 
4 #include "os.h"
5 #ifdef OS_MAC
6 
7 // Emulate Linux key constants for OSX
8 
9 #define KEY_ESC kVK_Escape
10 #define KEY_F1 kVK_F1
11 #define KEY_F2 kVK_F2
12 #define KEY_F3 kVK_F3
13 #define KEY_F4 kVK_F4
14 #define KEY_F5 kVK_F5
15 #define KEY_F6 kVK_F6
16 #define KEY_F7 kVK_F7
17 #define KEY_F8 kVK_F8
18 #define KEY_F9 kVK_F9
19 #define KEY_F10 kVK_F10
20 #define KEY_F11 kVK_F11
21 #define KEY_F12 kVK_F12
22 #define KEY_F13 kVK_F13
23 #define KEY_F14 kVK_F14
24 #define KEY_F15 kVK_F15
25 #define KEY_F16 kVK_F16
26 #define KEY_F17 kVK_F17
27 #define KEY_F18 kVK_F18
28 #define KEY_F19 kVK_F19
29 #define KEY_F20 kVK_F20
30 
31 #define KEY_1 kVK_ANSI_1
32 #define KEY_2 kVK_ANSI_2
33 #define KEY_3 kVK_ANSI_3
34 #define KEY_4 kVK_ANSI_4
35 #define KEY_5 kVK_ANSI_5
36 #define KEY_6 kVK_ANSI_6
37 #define KEY_7 kVK_ANSI_7
38 #define KEY_8 kVK_ANSI_8
39 #define KEY_9 kVK_ANSI_9
40 #define KEY_0 kVK_ANSI_0
41 
42 #define KEY_A kVK_ANSI_A
43 #define KEY_B kVK_ANSI_B
44 #define KEY_C kVK_ANSI_C
45 #define KEY_D kVK_ANSI_D
46 #define KEY_E kVK_ANSI_E
47 #define KEY_F kVK_ANSI_F
48 #define KEY_G kVK_ANSI_G
49 #define KEY_H kVK_ANSI_H
50 #define KEY_I kVK_ANSI_I
51 #define KEY_J kVK_ANSI_J
52 #define KEY_K kVK_ANSI_K
53 #define KEY_L kVK_ANSI_L
54 #define KEY_M kVK_ANSI_M
55 #define KEY_N kVK_ANSI_N
56 #define KEY_O kVK_ANSI_O
57 #define KEY_P kVK_ANSI_P
58 #define KEY_Q kVK_ANSI_Q
59 #define KEY_R kVK_ANSI_R
60 #define KEY_S kVK_ANSI_S
61 #define KEY_T kVK_ANSI_T
62 #define KEY_U kVK_ANSI_U
63 #define KEY_V kVK_ANSI_V
64 #define KEY_W kVK_ANSI_W
65 #define KEY_X kVK_ANSI_X
66 #define KEY_Y kVK_ANSI_Y
67 #define KEY_Z kVK_ANSI_Z
68 
69 #define KEY_GRAVE kVK_ANSI_Grave
70 #define KEY_102ND kVK_ISO_Section
71 #define KEY_MINUS kVK_ANSI_Minus
72 #define KEY_EQUAL kVK_ANSI_Equal
73 #define KEY_BACKSPACE kVK_Delete
74 #define KEY_LEFTBRACE kVK_ANSI_LeftBracket
75 #define KEY_RIGHTBRACE kVK_ANSI_RightBracket
76 #define KEY_BACKSLASH kVK_ANSI_Backslash
77 #define KEY_SEMICOLON kVK_ANSI_Semicolon
78 #define KEY_APOSTROPHE kVK_ANSI_Quote
79 #define KEY_ENTER kVK_Return
80 #define KEY_COMMA kVK_ANSI_Comma
81 #define KEY_DOT kVK_ANSI_Period
82 #define KEY_SLASH kVK_ANSI_Slash
83 #define KEY_SPACE kVK_Space
84 
85 #define KEY_TAB kVK_Tab
86 #define KEY_CAPSLOCK kVK_CapsLock
87 #define KEY_LEFTSHIFT kVK_Shift
88 #define KEY_RIGHTSHIFT kVK_RightShift
89 #define KEY_LEFTCTRL kVK_Control
90 #define KEY_RIGHTCTRL kVK_RightControl
91 #define KEY_LEFTMETA kVK_Command
92 #define KEY_RIGHTMETA (kVK_Command - 1) // This isn't listed as kVK_RightCommand for some reason?
93 #define KEY_LEFTALT kVK_Option
94 #define KEY_RIGHTALT kVK_RightOption
95 #define KEY_COMPOSE -1 // OSX has no context menu key
96 #define KEY_FN kVK_Function
97 
98 #define KEY_SYSRQ kVK_F13
99 #define KEY_SCROLLLOCK kVK_F14
100 #define KEY_PAUSE kVK_F15
101 #define KEY_INSERT kVK_Help
102 #define KEY_HOME kVK_Home
103 #define KEY_PAGEUP kVK_PageUp
104 #define KEY_DELETE kVK_ForwardDelete
105 #define KEY_END kVK_End
106 #define KEY_PAGEDOWN kVK_PageDown
107 
108 #define KEY_UP kVK_UpArrow
109 #define KEY_LEFT kVK_LeftArrow
110 #define KEY_DOWN kVK_DownArrow
111 #define KEY_RIGHT kVK_RightArrow
112 
113 #define KEY_NUMLOCK kVK_ANSI_KeypadClear
114 #define KEY_KPSLASH kVK_ANSI_KeypadDivide
115 #define KEY_KPASTERISK kVK_ANSI_KeypadMultiply
116 #define KEY_KPMINUS kVK_ANSI_KeypadMinus
117 #define KEY_KPPLUS kVK_ANSI_KeypadPlus
118 #define KEY_KPENTER kVK_ANSI_KeypadEnter
119 #define KEY_KPDOT kVK_ANSI_KeypadDecimal
120 #define KEY_KP1 kVK_ANSI_Keypad1
121 #define KEY_KP2 kVK_ANSI_Keypad2
122 #define KEY_KP3 kVK_ANSI_Keypad3
123 #define KEY_KP4 kVK_ANSI_Keypad4
124 #define KEY_KP5 kVK_ANSI_Keypad5
125 #define KEY_KP6 kVK_ANSI_Keypad6
126 #define KEY_KP7 kVK_ANSI_Keypad7
127 #define KEY_KP8 kVK_ANSI_Keypad8
128 #define KEY_KP9 kVK_ANSI_Keypad9
129 #define KEY_KP0 kVK_ANSI_Keypad0
130 
131 #define KEY_YEN kVK_JIS_Yen
132 #define KEY_RO kVK_JIS_Underscore
133 #define KEY_KATAKANAHIRAGANA kVK_JIS_Kana
134 #define KEY_HENKAN -1
135 #define KEY_MUHENKAN -1
136 
137 #define KEY_MEDIA 0x800
138 #define IS_MEDIA(scancode) ((scancode) >= KEY_MEDIA)
139 #define KEY_MUTE (KEY_MEDIA + NX_KEYTYPE_MUTE)
140 #define KEY_VOLUMEUP (KEY_MEDIA + NX_KEYTYPE_SOUND_UP)
141 #define KEY_VOLUMEDOWN (KEY_MEDIA + NX_KEYTYPE_SOUND_DOWN)
142 #define KEY_STOPCD -1 // OSX has no stop key
143 #define KEY_PREVIOUSSONG (KEY_MEDIA + NX_KEYTYPE_PREVIOUS)
144 #define KEY_PLAYPAUSE (KEY_MEDIA + NX_KEYTYPE_PLAY)
145 #define KEY_NEXTSONG (KEY_MEDIA + NX_KEYTYPE_NEXT)
146 #define KEY_BRIGHTNESSUP (KEY_MEDIA + NX_KEYTYPE_BRIGHTNESS_UP)
147 #define KEY_BRIGHTNESSDOWN (KEY_MEDIA + NX_KEYTYPE_BRIGHTNESS_DOWN)
148 #define KEY_EJECTCD (KEY_MEDIA + NX_KEYTYPE_EJECT)
149 #define KEY_POWER (KEY_MEDIA + NX_POWER_KEY)
150 
151 #define BTN_LEFT 0
152 #define BTN_RIGHT 1
153 #define BTN_MIDDLE 2
154 #define BTN_SIDE 4
155 #define BTN_EXTRA 5
156 #define BTN_FORWARD 6
157 #define BTN_BACK 7
158 #define BTN_TASK 8
159 
160 #endif // OS_MAC
161 
162 #endif // KEYMAP_MAC_H