WinRT: more keyboard code cleanups
authorDavid Ludwig <dludwig@pobox.com>
Sun, 26 Oct 2014 12:33:10 -0400
changeset 91935ca521b8486d
parent 9192 50b888469010
child 9194 583176c5982f
WinRT: more keyboard code cleanups
- made keycode listings a bit easier to read
- listed VK_ keycode names, where appropriate
- removed a few pieces of dead + commented-out code
- applied a common 'WINRT_' prefix to internal function names
src/video/winrt/SDL_winrtkeyboard.cpp
     1.1 --- a/src/video/winrt/SDL_winrtkeyboard.cpp	Sat Oct 25 08:54:23 2014 -0400
     1.2 +++ b/src/video/winrt/SDL_winrtkeyboard.cpp	Sun Oct 26 12:33:10 2014 -0400
     1.3 @@ -38,179 +38,179 @@
     1.4  
     1.5  
     1.6  static SDL_Scancode WinRT_Official_Keycodes[] = {
     1.7 -    SDL_SCANCODE_UNKNOWN, // VirtualKey.None -- 0
     1.8 -    SDL_SCANCODE_UNKNOWN, // VirtualKey.LeftButton -- 1
     1.9 -    SDL_SCANCODE_UNKNOWN, // VirtualKey.RightButton -- 2
    1.10 -    SDL_SCANCODE_CANCEL, // VirtualKey.Cancel -- 3
    1.11 -    SDL_SCANCODE_UNKNOWN, // VirtualKey.MiddleButton -- 4
    1.12 -    SDL_SCANCODE_UNKNOWN, // VirtualKey.XButton1 -- 5
    1.13 -    SDL_SCANCODE_UNKNOWN, // VirtualKey.XButton2 -- 6
    1.14 -    SDL_SCANCODE_UNKNOWN, // -- 7
    1.15 -    SDL_SCANCODE_BACKSPACE, // VirtualKey.Back -- 8
    1.16 -    SDL_SCANCODE_TAB, // VirtualKey.Tab -- 9
    1.17 -    SDL_SCANCODE_UNKNOWN, // -- 10
    1.18 -    SDL_SCANCODE_UNKNOWN, // -- 11
    1.19 -    SDL_SCANCODE_CLEAR, // VirtualKey.Clear -- 12
    1.20 -    SDL_SCANCODE_RETURN, // VirtualKey.Enter -- 13
    1.21 -    SDL_SCANCODE_UNKNOWN, // -- 14
    1.22 -    SDL_SCANCODE_UNKNOWN, // -- 15
    1.23 -    SDL_SCANCODE_LSHIFT, // VirtualKey.Shift -- 16
    1.24 -    SDL_SCANCODE_LCTRL, // VirtualKey.Control -- 17
    1.25 -    SDL_SCANCODE_MENU, // VirtualKey.Menu -- 18
    1.26 -    SDL_SCANCODE_PAUSE, // VirtualKey.Pause -- 19
    1.27 -    SDL_SCANCODE_CAPSLOCK, // VirtualKey.CapitalLock -- 20
    1.28 -    SDL_SCANCODE_UNKNOWN, // VirtualKey.Kana or VirtualKey.Hangul -- 21
    1.29 -    SDL_SCANCODE_UNKNOWN, // -- 22
    1.30 -    SDL_SCANCODE_UNKNOWN, // VirtualKey.Junja -- 23
    1.31 -    SDL_SCANCODE_UNKNOWN, // VirtualKey.Final -- 24
    1.32 -    SDL_SCANCODE_UNKNOWN, // VirtualKey.Hanja or VirtualKey.Kanji -- 25
    1.33 -    SDL_SCANCODE_UNKNOWN, // -- 26
    1.34 -    SDL_SCANCODE_ESCAPE, // VirtualKey.Escape -- 27
    1.35 -    SDL_SCANCODE_UNKNOWN, // VirtualKey.Convert -- 28
    1.36 -    SDL_SCANCODE_UNKNOWN, // VirtualKey.NonConvert -- 29
    1.37 -    SDL_SCANCODE_UNKNOWN, // VirtualKey.Accept -- 30
    1.38 -    SDL_SCANCODE_UNKNOWN, // VirtualKey.ModeChange -- 31  (maybe SDL_SCANCODE_MODE ?)
    1.39 -    SDL_SCANCODE_SPACE, // VirtualKey.Space -- 32
    1.40 -    SDL_SCANCODE_PAGEUP, // VirtualKey.PageUp -- 33
    1.41 -    SDL_SCANCODE_PAGEDOWN, // VirtualKey.PageDown -- 34
    1.42 -    SDL_SCANCODE_END, // VirtualKey.End -- 35
    1.43 -    SDL_SCANCODE_HOME, // VirtualKey.Home -- 36
    1.44 -    SDL_SCANCODE_LEFT, // VirtualKey.Left -- 37
    1.45 -    SDL_SCANCODE_UP, // VirtualKey.Up -- 38
    1.46 -    SDL_SCANCODE_RIGHT, // VirtualKey.Right -- 39
    1.47 -    SDL_SCANCODE_DOWN, // VirtualKey.Down -- 40
    1.48 -    SDL_SCANCODE_SELECT, // VirtualKey.Select -- 41
    1.49 -    SDL_SCANCODE_UNKNOWN, // VirtualKey.Print -- 42  (maybe SDL_SCANCODE_PRINTSCREEN ?)
    1.50 -    SDL_SCANCODE_EXECUTE, // VirtualKey.Execute -- 43
    1.51 -    SDL_SCANCODE_UNKNOWN, // VirtualKey.Snapshot -- 44
    1.52 -    SDL_SCANCODE_INSERT, // VirtualKey.Insert -- 45
    1.53 -    SDL_SCANCODE_DELETE, // VirtualKey.Delete -- 46
    1.54 -    SDL_SCANCODE_HELP, // VirtualKey.Help -- 47
    1.55 -    SDL_SCANCODE_0, // VirtualKey.Number0 -- 48
    1.56 -    SDL_SCANCODE_1, // VirtualKey.Number1 -- 49
    1.57 -    SDL_SCANCODE_2, // VirtualKey.Number2 -- 50
    1.58 -    SDL_SCANCODE_3, // VirtualKey.Number3 -- 51
    1.59 -    SDL_SCANCODE_4, // VirtualKey.Number4 -- 52
    1.60 -    SDL_SCANCODE_5, // VirtualKey.Number5 -- 53
    1.61 -    SDL_SCANCODE_6, // VirtualKey.Number6 -- 54
    1.62 -    SDL_SCANCODE_7, // VirtualKey.Number7 -- 55
    1.63 -    SDL_SCANCODE_8, // VirtualKey.Number8 -- 56
    1.64 -    SDL_SCANCODE_9, // VirtualKey.Number9 -- 57
    1.65 -    SDL_SCANCODE_UNKNOWN, // -- 58
    1.66 -    SDL_SCANCODE_UNKNOWN, // -- 59
    1.67 -    SDL_SCANCODE_UNKNOWN, // -- 60
    1.68 -    SDL_SCANCODE_UNKNOWN, // -- 61
    1.69 -    SDL_SCANCODE_UNKNOWN, // -- 62
    1.70 -    SDL_SCANCODE_UNKNOWN, // -- 63
    1.71 -    SDL_SCANCODE_UNKNOWN, // -- 64
    1.72 -    SDL_SCANCODE_A, // VirtualKey.A -- 65
    1.73 -    SDL_SCANCODE_B, // VirtualKey.B -- 66
    1.74 -    SDL_SCANCODE_C, // VirtualKey.C -- 67
    1.75 -    SDL_SCANCODE_D, // VirtualKey.D -- 68
    1.76 -    SDL_SCANCODE_E, // VirtualKey.E -- 69
    1.77 -    SDL_SCANCODE_F, // VirtualKey.F -- 70
    1.78 -    SDL_SCANCODE_G, // VirtualKey.G -- 71
    1.79 -    SDL_SCANCODE_H, // VirtualKey.H -- 72
    1.80 -    SDL_SCANCODE_I, // VirtualKey.I -- 73
    1.81 -    SDL_SCANCODE_J, // VirtualKey.J -- 74
    1.82 -    SDL_SCANCODE_K, // VirtualKey.K -- 75
    1.83 -    SDL_SCANCODE_L, // VirtualKey.L -- 76
    1.84 -    SDL_SCANCODE_M, // VirtualKey.M -- 77
    1.85 -    SDL_SCANCODE_N, // VirtualKey.N -- 78
    1.86 -    SDL_SCANCODE_O, // VirtualKey.O -- 79
    1.87 -    SDL_SCANCODE_P, // VirtualKey.P -- 80
    1.88 -    SDL_SCANCODE_Q, // VirtualKey.Q -- 81
    1.89 -    SDL_SCANCODE_R, // VirtualKey.R -- 82
    1.90 -    SDL_SCANCODE_S, // VirtualKey.S -- 83
    1.91 -    SDL_SCANCODE_T, // VirtualKey.T -- 84
    1.92 -    SDL_SCANCODE_U, // VirtualKey.U -- 85
    1.93 -    SDL_SCANCODE_V, // VirtualKey.V -- 86
    1.94 -    SDL_SCANCODE_W, // VirtualKey.W -- 87
    1.95 -    SDL_SCANCODE_X, // VirtualKey.X -- 88
    1.96 -    SDL_SCANCODE_Y, // VirtualKey.Y -- 89
    1.97 -    SDL_SCANCODE_Z, // VirtualKey.Z -- 90
    1.98 -    SDL_SCANCODE_UNKNOWN, // VirtualKey.LeftWindows -- 91  (maybe SDL_SCANCODE_APPLICATION or SDL_SCANCODE_LGUI ?)
    1.99 -    SDL_SCANCODE_UNKNOWN, // VirtualKey.RightWindows -- 92  (maybe SDL_SCANCODE_APPLICATION or SDL_SCANCODE_RGUI ?)
   1.100 -    SDL_SCANCODE_APPLICATION, // VirtualKey.Application -- 93
   1.101 -    SDL_SCANCODE_UNKNOWN, // -- 94
   1.102 -    SDL_SCANCODE_SLEEP, // VirtualKey.Sleep -- 95
   1.103 -    SDL_SCANCODE_KP_0, // VirtualKey.NumberPad0 -- 96
   1.104 -    SDL_SCANCODE_KP_1, // VirtualKey.NumberPad1 -- 97
   1.105 -    SDL_SCANCODE_KP_2, // VirtualKey.NumberPad2 -- 98
   1.106 -    SDL_SCANCODE_KP_3, // VirtualKey.NumberPad3 -- 99
   1.107 -    SDL_SCANCODE_KP_4, // VirtualKey.NumberPad4 -- 100
   1.108 -    SDL_SCANCODE_KP_5, // VirtualKey.NumberPad5 -- 101
   1.109 -    SDL_SCANCODE_KP_6, // VirtualKey.NumberPad6 -- 102
   1.110 -    SDL_SCANCODE_KP_7, // VirtualKey.NumberPad7 -- 103
   1.111 -    SDL_SCANCODE_KP_8, // VirtualKey.NumberPad8 -- 104
   1.112 -    SDL_SCANCODE_KP_9, // VirtualKey.NumberPad9 -- 105
   1.113 -    SDL_SCANCODE_KP_MULTIPLY, // VirtualKey.Multiply -- 106
   1.114 -    SDL_SCANCODE_KP_PLUS, // VirtualKey.Add -- 107
   1.115 -    SDL_SCANCODE_UNKNOWN, // VirtualKey.Separator -- 108
   1.116 -    SDL_SCANCODE_KP_MINUS, // VirtualKey.Subtract -- 109
   1.117 -    SDL_SCANCODE_UNKNOWN, // VirtualKey.Decimal -- 110  (maybe SDL_SCANCODE_DECIMALSEPARATOR, SDL_SCANCODE_KP_DECIMAL, or SDL_SCANCODE_KP_PERIOD ?)
   1.118 -    SDL_SCANCODE_KP_DIVIDE, // VirtualKey.Divide -- 111
   1.119 -    SDL_SCANCODE_F1, // VirtualKey.F1 -- 112
   1.120 -    SDL_SCANCODE_F2, // VirtualKey.F2 -- 113
   1.121 -    SDL_SCANCODE_F3, // VirtualKey.F3 -- 114
   1.122 -    SDL_SCANCODE_F4, // VirtualKey.F4 -- 115
   1.123 -    SDL_SCANCODE_F5, // VirtualKey.F5 -- 116
   1.124 -    SDL_SCANCODE_F6, // VirtualKey.F6 -- 117
   1.125 -    SDL_SCANCODE_F7, // VirtualKey.F7 -- 118
   1.126 -    SDL_SCANCODE_F8, // VirtualKey.F8 -- 119
   1.127 -    SDL_SCANCODE_F9, // VirtualKey.F9 -- 120
   1.128 -    SDL_SCANCODE_F10, // VirtualKey.F10 -- 121
   1.129 -    SDL_SCANCODE_F11, // VirtualKey.F11 -- 122
   1.130 -    SDL_SCANCODE_F12, // VirtualKey.F12 -- 123
   1.131 -    SDL_SCANCODE_F13, // VirtualKey.F13 -- 124
   1.132 -    SDL_SCANCODE_F14, // VirtualKey.F14 -- 125
   1.133 -    SDL_SCANCODE_F15, // VirtualKey.F15 -- 126
   1.134 -    SDL_SCANCODE_F16, // VirtualKey.F16 -- 127
   1.135 -    SDL_SCANCODE_F17, // VirtualKey.F17 -- 128
   1.136 -    SDL_SCANCODE_F18, // VirtualKey.F18 -- 129
   1.137 -    SDL_SCANCODE_F19, // VirtualKey.F19 -- 130
   1.138 -    SDL_SCANCODE_F20, // VirtualKey.F20 -- 131
   1.139 -    SDL_SCANCODE_F21, // VirtualKey.F21 -- 132
   1.140 -    SDL_SCANCODE_F22, // VirtualKey.F22 -- 133
   1.141 -    SDL_SCANCODE_F23, // VirtualKey.F23 -- 134
   1.142 -    SDL_SCANCODE_F24, // VirtualKey.F24 -- 135
   1.143 -    SDL_SCANCODE_UNKNOWN, // -- 136
   1.144 -    SDL_SCANCODE_UNKNOWN, // -- 137
   1.145 -    SDL_SCANCODE_UNKNOWN, // -- 138
   1.146 -    SDL_SCANCODE_UNKNOWN, // -- 139
   1.147 -    SDL_SCANCODE_UNKNOWN, // -- 140
   1.148 -    SDL_SCANCODE_UNKNOWN, // -- 141
   1.149 -    SDL_SCANCODE_UNKNOWN, // -- 142
   1.150 -    SDL_SCANCODE_UNKNOWN, // -- 143
   1.151 -    SDL_SCANCODE_NUMLOCKCLEAR, // VirtualKey.NumberKeyLock -- 144
   1.152 -    SDL_SCANCODE_SCROLLLOCK, // VirtualKey.Scroll -- 145
   1.153 -    SDL_SCANCODE_UNKNOWN, // -- 146
   1.154 -    SDL_SCANCODE_UNKNOWN, // -- 147
   1.155 -    SDL_SCANCODE_UNKNOWN, // -- 148
   1.156 -    SDL_SCANCODE_UNKNOWN, // -- 149
   1.157 -    SDL_SCANCODE_UNKNOWN, // -- 150
   1.158 -    SDL_SCANCODE_UNKNOWN, // -- 151
   1.159 -    SDL_SCANCODE_UNKNOWN, // -- 152
   1.160 -    SDL_SCANCODE_UNKNOWN, // -- 153
   1.161 -    SDL_SCANCODE_UNKNOWN, // -- 154
   1.162 -    SDL_SCANCODE_UNKNOWN, // -- 155
   1.163 -    SDL_SCANCODE_UNKNOWN, // -- 156
   1.164 -    SDL_SCANCODE_UNKNOWN, // -- 157
   1.165 -    SDL_SCANCODE_UNKNOWN, // -- 158
   1.166 -    SDL_SCANCODE_UNKNOWN, // -- 159
   1.167 -    SDL_SCANCODE_LSHIFT, // VirtualKey.LeftShift -- 160
   1.168 -    SDL_SCANCODE_RSHIFT, // VirtualKey.RightShift -- 161
   1.169 -    SDL_SCANCODE_LCTRL, // VirtualKey.LeftControl -- 162
   1.170 -    SDL_SCANCODE_RCTRL, // VirtualKey.RightControl -- 163
   1.171 -    SDL_SCANCODE_MENU, // VirtualKey.LeftMenu -- 164
   1.172 -    SDL_SCANCODE_MENU, // VirtualKey.RightMenu -- 165
   1.173 -    SDL_SCANCODE_AC_BACK, // VirtualKey.GoBack -- 166 : The go back key.
   1.174 -    SDL_SCANCODE_AC_FORWARD, // VirtualKey.GoForward -- 167 : The go forward key.
   1.175 -    SDL_SCANCODE_AC_REFRESH, // VirtualKey.Refresh -- 168 : The refresh key.
   1.176 -    SDL_SCANCODE_AC_STOP, // VirtualKey.Stop -- 169 : The stop key.
   1.177 -    SDL_SCANCODE_AC_SEARCH, // VirtualKey.Search -- 170 : The search key.
   1.178 -    SDL_SCANCODE_AC_BOOKMARKS, // VirtualKey.Favorites -- 171 : The favorites key.
   1.179 -    SDL_SCANCODE_AC_HOME // VirtualKey.GoHome -- 172 : The go home key.
   1.180 +    SDL_SCANCODE_UNKNOWN,       /* VirtualKey.None -- 0 */
   1.181 +    SDL_SCANCODE_UNKNOWN,       /* VirtualKey.LeftButton -- 1 */
   1.182 +    SDL_SCANCODE_UNKNOWN,       /* VirtualKey.RightButton -- 2 */
   1.183 +    SDL_SCANCODE_CANCEL,        /* VirtualKey.Cancel -- 3 */
   1.184 +    SDL_SCANCODE_UNKNOWN,       /* VirtualKey.MiddleButton -- 4 */
   1.185 +    SDL_SCANCODE_UNKNOWN,       /* VirtualKey.XButton1 -- 5 */
   1.186 +    SDL_SCANCODE_UNKNOWN,       /* VirtualKey.XButton2 -- 6 */
   1.187 +    SDL_SCANCODE_UNKNOWN,       /* -- 7 */
   1.188 +    SDL_SCANCODE_BACKSPACE,     /* VirtualKey.Back -- 8 */
   1.189 +    SDL_SCANCODE_TAB,           /* VirtualKey.Tab -- 9 */
   1.190 +    SDL_SCANCODE_UNKNOWN,       /* -- 10 */
   1.191 +    SDL_SCANCODE_UNKNOWN,       /* -- 11 */
   1.192 +    SDL_SCANCODE_CLEAR,         /* VirtualKey.Clear -- 12 */
   1.193 +    SDL_SCANCODE_RETURN,        /* VirtualKey.Enter -- 13 */
   1.194 +    SDL_SCANCODE_UNKNOWN,       /* -- 14 */
   1.195 +    SDL_SCANCODE_UNKNOWN,       /* -- 15 */
   1.196 +    SDL_SCANCODE_LSHIFT,        /* VirtualKey.Shift -- 16 */
   1.197 +    SDL_SCANCODE_LCTRL,         /* VirtualKey.Control -- 17 */
   1.198 +    SDL_SCANCODE_MENU,          /* VirtualKey.Menu -- 18 */
   1.199 +    SDL_SCANCODE_PAUSE,         /* VirtualKey.Pause -- 19 */
   1.200 +    SDL_SCANCODE_CAPSLOCK,      /* VirtualKey.CapitalLock -- 20 */
   1.201 +    SDL_SCANCODE_UNKNOWN,       /* VirtualKey.Kana or VirtualKey.Hangul -- 21 */
   1.202 +    SDL_SCANCODE_UNKNOWN,       /* -- 22 */
   1.203 +    SDL_SCANCODE_UNKNOWN,       /* VirtualKey.Junja -- 23 */
   1.204 +    SDL_SCANCODE_UNKNOWN,       /* VirtualKey.Final -- 24 */
   1.205 +    SDL_SCANCODE_UNKNOWN,       /* VirtualKey.Hanja or VirtualKey.Kanji -- 25 */
   1.206 +    SDL_SCANCODE_UNKNOWN,       /* -- 26 */
   1.207 +    SDL_SCANCODE_ESCAPE,        /* VirtualKey.Escape -- 27 */
   1.208 +    SDL_SCANCODE_UNKNOWN,       /* VirtualKey.Convert -- 28 */
   1.209 +    SDL_SCANCODE_UNKNOWN,       /* VirtualKey.NonConvert -- 29 */
   1.210 +    SDL_SCANCODE_UNKNOWN,       /* VirtualKey.Accept -- 30 */
   1.211 +    SDL_SCANCODE_UNKNOWN,       /* VirtualKey.ModeChange -- 31  (maybe SDL_SCANCODE_MODE ?) */
   1.212 +    SDL_SCANCODE_SPACE,         /* VirtualKey.Space -- 32 */
   1.213 +    SDL_SCANCODE_PAGEUP,        /* VirtualKey.PageUp -- 33 */
   1.214 +    SDL_SCANCODE_PAGEDOWN,      /* VirtualKey.PageDown -- 34 */
   1.215 +    SDL_SCANCODE_END,           /* VirtualKey.End -- 35 */
   1.216 +    SDL_SCANCODE_HOME,          /* VirtualKey.Home -- 36 */
   1.217 +    SDL_SCANCODE_LEFT,          /* VirtualKey.Left -- 37 */
   1.218 +    SDL_SCANCODE_UP,            /* VirtualKey.Up -- 38 */
   1.219 +    SDL_SCANCODE_RIGHT,         /* VirtualKey.Right -- 39 */
   1.220 +    SDL_SCANCODE_DOWN,          /* VirtualKey.Down -- 40 */
   1.221 +    SDL_SCANCODE_SELECT,        /* VirtualKey.Select -- 41 */
   1.222 +    SDL_SCANCODE_UNKNOWN,       /* VirtualKey.Print -- 42  (maybe SDL_SCANCODE_PRINTSCREEN ?) */
   1.223 +    SDL_SCANCODE_EXECUTE,       /* VirtualKey.Execute -- 43 */
   1.224 +    SDL_SCANCODE_UNKNOWN,       /* VirtualKey.Snapshot -- 44 */
   1.225 +    SDL_SCANCODE_INSERT,        /* VirtualKey.Insert -- 45 */
   1.226 +    SDL_SCANCODE_DELETE,        /* VirtualKey.Delete -- 46 */
   1.227 +    SDL_SCANCODE_HELP,          /* VirtualKey.Help -- 47 */
   1.228 +    SDL_SCANCODE_0,             /* VirtualKey.Number0 -- 48 */
   1.229 +    SDL_SCANCODE_1,             /* VirtualKey.Number1 -- 49 */
   1.230 +    SDL_SCANCODE_2,             /* VirtualKey.Number2 -- 50 */
   1.231 +    SDL_SCANCODE_3,             /* VirtualKey.Number3 -- 51 */
   1.232 +    SDL_SCANCODE_4,             /* VirtualKey.Number4 -- 52 */
   1.233 +    SDL_SCANCODE_5,             /* VirtualKey.Number5 -- 53 */
   1.234 +    SDL_SCANCODE_6,             /* VirtualKey.Number6 -- 54 */
   1.235 +    SDL_SCANCODE_7,             /* VirtualKey.Number7 -- 55 */
   1.236 +    SDL_SCANCODE_8,             /* VirtualKey.Number8 -- 56 */
   1.237 +    SDL_SCANCODE_9,             /* VirtualKey.Number9 -- 57 */
   1.238 +    SDL_SCANCODE_UNKNOWN,       /* -- 58 */
   1.239 +    SDL_SCANCODE_UNKNOWN,       /* -- 59 */
   1.240 +    SDL_SCANCODE_UNKNOWN,       /* -- 60 */
   1.241 +    SDL_SCANCODE_UNKNOWN,       /* -- 61 */
   1.242 +    SDL_SCANCODE_UNKNOWN,       /* -- 62 */
   1.243 +    SDL_SCANCODE_UNKNOWN,       /* -- 63 */
   1.244 +    SDL_SCANCODE_UNKNOWN,       /* -- 64 */
   1.245 +    SDL_SCANCODE_A,             /* VirtualKey.A -- 65 */
   1.246 +    SDL_SCANCODE_B,             /* VirtualKey.B -- 66 */
   1.247 +    SDL_SCANCODE_C,             /* VirtualKey.C -- 67 */
   1.248 +    SDL_SCANCODE_D,             /* VirtualKey.D -- 68 */
   1.249 +    SDL_SCANCODE_E,             /* VirtualKey.E -- 69 */
   1.250 +    SDL_SCANCODE_F,             /* VirtualKey.F -- 70 */
   1.251 +    SDL_SCANCODE_G,             /* VirtualKey.G -- 71 */
   1.252 +    SDL_SCANCODE_H,             /* VirtualKey.H -- 72 */
   1.253 +    SDL_SCANCODE_I,             /* VirtualKey.I -- 73 */
   1.254 +    SDL_SCANCODE_J,             /* VirtualKey.J -- 74 */
   1.255 +    SDL_SCANCODE_K,             /* VirtualKey.K -- 75 */
   1.256 +    SDL_SCANCODE_L,             /* VirtualKey.L -- 76 */
   1.257 +    SDL_SCANCODE_M,             /* VirtualKey.M -- 77 */
   1.258 +    SDL_SCANCODE_N,             /* VirtualKey.N -- 78 */
   1.259 +    SDL_SCANCODE_O,             /* VirtualKey.O -- 79 */
   1.260 +    SDL_SCANCODE_P,             /* VirtualKey.P -- 80 */
   1.261 +    SDL_SCANCODE_Q,             /* VirtualKey.Q -- 81 */
   1.262 +    SDL_SCANCODE_R,             /* VirtualKey.R -- 82 */
   1.263 +    SDL_SCANCODE_S,             /* VirtualKey.S -- 83 */
   1.264 +    SDL_SCANCODE_T,             /* VirtualKey.T -- 84 */
   1.265 +    SDL_SCANCODE_U,             /* VirtualKey.U -- 85 */
   1.266 +    SDL_SCANCODE_V,             /* VirtualKey.V -- 86 */
   1.267 +    SDL_SCANCODE_W,             /* VirtualKey.W -- 87 */
   1.268 +    SDL_SCANCODE_X,             /* VirtualKey.X -- 88 */
   1.269 +    SDL_SCANCODE_Y,             /* VirtualKey.Y -- 89 */
   1.270 +    SDL_SCANCODE_Z,             /* VirtualKey.Z -- 90 */
   1.271 +    SDL_SCANCODE_UNKNOWN,       /* VirtualKey.LeftWindows -- 91  (maybe SDL_SCANCODE_APPLICATION or SDL_SCANCODE_LGUI ?) */
   1.272 +    SDL_SCANCODE_UNKNOWN,       /* VirtualKey.RightWindows -- 92  (maybe SDL_SCANCODE_APPLICATION or SDL_SCANCODE_RGUI ?) */
   1.273 +    SDL_SCANCODE_APPLICATION,   /* VirtualKey.Application -- 93 */
   1.274 +    SDL_SCANCODE_UNKNOWN,       /* -- 94 */
   1.275 +    SDL_SCANCODE_SLEEP,         /* VirtualKey.Sleep -- 95 */
   1.276 +    SDL_SCANCODE_KP_0,          /* VirtualKey.NumberPad0 -- 96 */
   1.277 +    SDL_SCANCODE_KP_1,          /* VirtualKey.NumberPad1 -- 97 */
   1.278 +    SDL_SCANCODE_KP_2,          /* VirtualKey.NumberPad2 -- 98 */
   1.279 +    SDL_SCANCODE_KP_3,          /* VirtualKey.NumberPad3 -- 99 */
   1.280 +    SDL_SCANCODE_KP_4,          /* VirtualKey.NumberPad4 -- 100 */
   1.281 +    SDL_SCANCODE_KP_5,          /* VirtualKey.NumberPad5 -- 101 */
   1.282 +    SDL_SCANCODE_KP_6,          /* VirtualKey.NumberPad6 -- 102 */
   1.283 +    SDL_SCANCODE_KP_7,          /* VirtualKey.NumberPad7 -- 103 */
   1.284 +    SDL_SCANCODE_KP_8,          /* VirtualKey.NumberPad8 -- 104 */
   1.285 +    SDL_SCANCODE_KP_9,          /* VirtualKey.NumberPad9 -- 105 */
   1.286 +    SDL_SCANCODE_KP_MULTIPLY,   /* VirtualKey.Multiply -- 106 */
   1.287 +    SDL_SCANCODE_KP_PLUS,       /* VirtualKey.Add -- 107 */
   1.288 +    SDL_SCANCODE_UNKNOWN,       /* VirtualKey.Separator -- 108 */
   1.289 +    SDL_SCANCODE_KP_MINUS,      /* VirtualKey.Subtract -- 109 */
   1.290 +    SDL_SCANCODE_UNKNOWN,       /* VirtualKey.Decimal -- 110  (maybe SDL_SCANCODE_DECIMALSEPARATOR, SDL_SCANCODE_KP_DECIMAL, or SDL_SCANCODE_KP_PERIOD ?) */
   1.291 +    SDL_SCANCODE_KP_DIVIDE,     /* VirtualKey.Divide -- 111 */
   1.292 +    SDL_SCANCODE_F1,            /* VirtualKey.F1 -- 112 */
   1.293 +    SDL_SCANCODE_F2,            /* VirtualKey.F2 -- 113 */
   1.294 +    SDL_SCANCODE_F3,            /* VirtualKey.F3 -- 114 */
   1.295 +    SDL_SCANCODE_F4,            /* VirtualKey.F4 -- 115 */
   1.296 +    SDL_SCANCODE_F5,            /* VirtualKey.F5 -- 116 */
   1.297 +    SDL_SCANCODE_F6,            /* VirtualKey.F6 -- 117 */
   1.298 +    SDL_SCANCODE_F7,            /* VirtualKey.F7 -- 118 */
   1.299 +    SDL_SCANCODE_F8,            /* VirtualKey.F8 -- 119 */
   1.300 +    SDL_SCANCODE_F9,            /* VirtualKey.F9 -- 120 */
   1.301 +    SDL_SCANCODE_F10,           /* VirtualKey.F10 -- 121 */
   1.302 +    SDL_SCANCODE_F11,           /* VirtualKey.F11 -- 122 */
   1.303 +    SDL_SCANCODE_F12,           /* VirtualKey.F12 -- 123 */
   1.304 +    SDL_SCANCODE_F13,           /* VirtualKey.F13 -- 124 */
   1.305 +    SDL_SCANCODE_F14,           /* VirtualKey.F14 -- 125 */
   1.306 +    SDL_SCANCODE_F15,           /* VirtualKey.F15 -- 126 */
   1.307 +    SDL_SCANCODE_F16,           /* VirtualKey.F16 -- 127 */
   1.308 +    SDL_SCANCODE_F17,           /* VirtualKey.F17 -- 128 */
   1.309 +    SDL_SCANCODE_F18,           /* VirtualKey.F18 -- 129 */
   1.310 +    SDL_SCANCODE_F19,           /* VirtualKey.F19 -- 130 */
   1.311 +    SDL_SCANCODE_F20,           /* VirtualKey.F20 -- 131 */
   1.312 +    SDL_SCANCODE_F21,           /* VirtualKey.F21 -- 132 */
   1.313 +    SDL_SCANCODE_F22,           /* VirtualKey.F22 -- 133 */
   1.314 +    SDL_SCANCODE_F23,           /* VirtualKey.F23 -- 134 */
   1.315 +    SDL_SCANCODE_F24,           /* VirtualKey.F24 -- 135 */
   1.316 +    SDL_SCANCODE_UNKNOWN,       /* -- 136 */
   1.317 +    SDL_SCANCODE_UNKNOWN,       /* -- 137 */
   1.318 +    SDL_SCANCODE_UNKNOWN,       /* -- 138 */
   1.319 +    SDL_SCANCODE_UNKNOWN,       /* -- 139 */
   1.320 +    SDL_SCANCODE_UNKNOWN,       /* -- 140 */
   1.321 +    SDL_SCANCODE_UNKNOWN,       /* -- 141 */
   1.322 +    SDL_SCANCODE_UNKNOWN,       /* -- 142 */
   1.323 +    SDL_SCANCODE_UNKNOWN,       /* -- 143 */
   1.324 +    SDL_SCANCODE_NUMLOCKCLEAR,  /* VirtualKey.NumberKeyLock -- 144 */
   1.325 +    SDL_SCANCODE_SCROLLLOCK,    /* VirtualKey.Scroll -- 145 */
   1.326 +    SDL_SCANCODE_UNKNOWN,       /* -- 146 */
   1.327 +    SDL_SCANCODE_UNKNOWN,       /* -- 147 */
   1.328 +    SDL_SCANCODE_UNKNOWN,       /* -- 148 */
   1.329 +    SDL_SCANCODE_UNKNOWN,       /* -- 149 */
   1.330 +    SDL_SCANCODE_UNKNOWN,       /* -- 150 */
   1.331 +    SDL_SCANCODE_UNKNOWN,       /* -- 151 */
   1.332 +    SDL_SCANCODE_UNKNOWN,       /* -- 152 */
   1.333 +    SDL_SCANCODE_UNKNOWN,       /* -- 153 */
   1.334 +    SDL_SCANCODE_UNKNOWN,       /* -- 154 */
   1.335 +    SDL_SCANCODE_UNKNOWN,       /* -- 155 */
   1.336 +    SDL_SCANCODE_UNKNOWN,       /* -- 156 */
   1.337 +    SDL_SCANCODE_UNKNOWN,       /* -- 157 */
   1.338 +    SDL_SCANCODE_UNKNOWN,       /* -- 158 */
   1.339 +    SDL_SCANCODE_UNKNOWN,       /* -- 159 */
   1.340 +    SDL_SCANCODE_LSHIFT,        /* VirtualKey.LeftShift -- 160 */
   1.341 +    SDL_SCANCODE_RSHIFT,        /* VirtualKey.RightShift -- 161 */
   1.342 +    SDL_SCANCODE_LCTRL,         /* VirtualKey.LeftControl -- 162 */
   1.343 +    SDL_SCANCODE_RCTRL,         /* VirtualKey.RightControl -- 163 */
   1.344 +    SDL_SCANCODE_MENU,          /* VirtualKey.LeftMenu -- 164 */
   1.345 +    SDL_SCANCODE_MENU,          /* VirtualKey.RightMenu -- 165 */
   1.346 +    SDL_SCANCODE_AC_BACK,       /* VirtualKey.GoBack -- 166 : The go back key. */
   1.347 +    SDL_SCANCODE_AC_FORWARD,    /* VirtualKey.GoForward -- 167 : The go forward key. */
   1.348 +    SDL_SCANCODE_AC_REFRESH,    /* VirtualKey.Refresh -- 168 : The refresh key. */
   1.349 +    SDL_SCANCODE_AC_STOP,       /* VirtualKey.Stop -- 169 : The stop key. */
   1.350 +    SDL_SCANCODE_AC_SEARCH,     /* VirtualKey.Search -- 170 : The search key. */
   1.351 +    SDL_SCANCODE_AC_BOOKMARKS,  /* VirtualKey.Favorites -- 171 : The favorites key. */
   1.352 +    SDL_SCANCODE_AC_HOME        /* VirtualKey.GoHome -- 172 : The go home key. */
   1.353  };
   1.354  
   1.355  /* Attempt to translate a keycode that isn't listed in WinRT's VirtualKey enum.
   1.356 @@ -219,43 +219,43 @@
   1.357  WINRT_TranslateUnofficialKeycode(int keycode)
   1.358  {
   1.359      switch (keycode) {
   1.360 -        case 173: return SDL_SCANCODE_MUTE;
   1.361 -        case 174: return SDL_SCANCODE_VOLUMEDOWN;
   1.362 -        case 175: return SDL_SCANCODE_VOLUMEUP;
   1.363 -        case 176: return SDL_SCANCODE_AUDIONEXT;
   1.364 -        case 177: return SDL_SCANCODE_AUDIOPREV;
   1.365 -        // case 178: return ;
   1.366 -        case 179: return SDL_SCANCODE_AUDIOPLAY;
   1.367 -        case 180: return SDL_SCANCODE_MAIL;
   1.368 -        case 181: return SDL_SCANCODE_MEDIASELECT;
   1.369 -        // case 182: return ;
   1.370 -        case 183: return SDL_SCANCODE_CALCULATOR;
   1.371 -        // case 184: return ;
   1.372 -        // case 185: return ;
   1.373 -        case 186: return SDL_SCANCODE_SEMICOLON;
   1.374 -        case 187: return SDL_SCANCODE_EQUALS;
   1.375 -        case 188: return SDL_SCANCODE_COMMA;
   1.376 -        case 189: return SDL_SCANCODE_MINUS;
   1.377 -        case 190: return SDL_SCANCODE_PERIOD;
   1.378 -        case 191: return SDL_SCANCODE_SLASH;
   1.379 -        case 192: return SDL_SCANCODE_GRAVE;
   1.380 +        case 173: return SDL_SCANCODE_MUTE;         /* VK_VOLUME_MUTE */
   1.381 +        case 174: return SDL_SCANCODE_VOLUMEDOWN;   /* VK_VOLUME_DOWN */
   1.382 +        case 175: return SDL_SCANCODE_VOLUMEUP;     /* VK_VOLUME_UP */
   1.383 +        case 176: return SDL_SCANCODE_AUDIONEXT;    /* VK_MEDIA_NEXT_TRACK */
   1.384 +        case 177: return SDL_SCANCODE_AUDIOPREV;    /* VK_MEDIA_PREV_TRACK */
   1.385 +        // case 178: return ;                       /* VK_MEDIA_STOP */
   1.386 +        case 179: return SDL_SCANCODE_AUDIOPLAY;    /* VK_MEDIA_PLAY_PAUSE */
   1.387 +        case 180: return SDL_SCANCODE_MAIL;         /* VK_LAUNCH_MAIL */
   1.388 +        case 181: return SDL_SCANCODE_MEDIASELECT;  /* VK_LAUNCH_MEDIA_SELECT */
   1.389 +        // case 182: return ;                       /* VK_LAUNCH_APP1 */
   1.390 +        case 183: return SDL_SCANCODE_CALCULATOR;   /* VK_LAUNCH_APP2 */
   1.391 +        // case 184: return ;                       /* ... reserved ... */
   1.392 +        // case 185: return ;                       /* ... reserved ... */
   1.393 +        case 186: return SDL_SCANCODE_SEMICOLON;    /* VK_OEM_1, ';:' key on US standard keyboards */
   1.394 +        case 187: return SDL_SCANCODE_EQUALS;       /* VK_OEM_PLUS */
   1.395 +        case 188: return SDL_SCANCODE_COMMA;        /* VK_OEM_COMMA */
   1.396 +        case 189: return SDL_SCANCODE_MINUS;        /* VK_OEM_MINUS */
   1.397 +        case 190: return SDL_SCANCODE_PERIOD;       /* VK_OEM_PERIOD */
   1.398 +        case 191: return SDL_SCANCODE_SLASH;        /* VK_OEM_2, '/?' key on US standard keyboards */
   1.399 +        case 192: return SDL_SCANCODE_GRAVE;        /* VK_OEM_3, '`~' key on US standard keyboards */
   1.400          // ?
   1.401 -        // ...
   1.402 +        // ... reserved or unassigned ...
   1.403          // ?
   1.404 -        case 219: return SDL_SCANCODE_LEFTBRACKET;
   1.405 -        case 220: return SDL_SCANCODE_BACKSLASH;
   1.406 -        case 221: return SDL_SCANCODE_RIGHTBRACKET;
   1.407 -        case 222: return SDL_SCANCODE_APOSTROPHE;
   1.408 +        case 219: return SDL_SCANCODE_LEFTBRACKET;  /* VK_OEM_4, '[{' key on US standard keyboards */
   1.409 +        case 220: return SDL_SCANCODE_BACKSLASH;    /* VK_OEM_5, '\|' key on US standard keyboards */
   1.410 +        case 221: return SDL_SCANCODE_RIGHTBRACKET; /* VK_OEM_6, ']}' key on US standard keyboards */
   1.411 +        case 222: return SDL_SCANCODE_APOSTROPHE;   /* VK_OEM_7, 'single/double quote' on US standard keyboards */
   1.412          default: break;
   1.413      }
   1.414      return SDL_SCANCODE_UNKNOWN;
   1.415  }
   1.416  
   1.417  static SDL_Scancode
   1.418 -TranslateKeycode(int keycode, unsigned int nativeScancode)
   1.419 +WINRT_TranslateKeycode(int keycode, unsigned int nativeScancode)
   1.420  {
   1.421      // TODO, WinRT: try filling out the WinRT keycode table as much as possible, using the Win32 table for interpretation hints
   1.422 -    //SDL_Log("WinRT TranslateKeycode, keycode=%d\n", (int)keycode);
   1.423 +
   1.424      SDL_Scancode scancode = SDL_SCANCODE_UNKNOWN;
   1.425  
   1.426      /* HACK ALERT: At least one VirtualKey constant (Shift) with a left/right
   1.427 @@ -316,7 +316,7 @@
   1.428  void
   1.429  WINRT_ProcessKeyDownEvent(Windows::UI::Core::KeyEventArgs ^args)
   1.430  {
   1.431 -    SDL_Scancode sdlScancode = TranslateKeycode((int)args->VirtualKey, args->KeyStatus.ScanCode);
   1.432 +    SDL_Scancode sdlScancode = WINRT_TranslateKeycode((int)args->VirtualKey, args->KeyStatus.ScanCode);
   1.433  #if 0
   1.434      SDL_Keycode keycode = SDL_GetKeyFromScancode(sdlScancode);
   1.435      SDL_Log("key down, handled=%s, ext?=%s, released?=%s, menu key down?=%s, "
   1.436 @@ -335,7 +335,6 @@
   1.437          keycode,
   1.438          SDL_GetKeyName(keycode));
   1.439      //args->Handled = true;
   1.440 -    //VirtualKey vkey = args->VirtualKey;
   1.441  #endif
   1.442      SDL_SendKeyboardKey(SDL_PRESSED, sdlScancode);
   1.443  }
   1.444 @@ -343,7 +342,7 @@
   1.445  void
   1.446  WINRT_ProcessKeyUpEvent(Windows::UI::Core::KeyEventArgs ^args)
   1.447  {
   1.448 -    SDL_Scancode sdlScancode = TranslateKeycode((int)args->VirtualKey, args->KeyStatus.ScanCode);
   1.449 +    SDL_Scancode sdlScancode = WINRT_TranslateKeycode((int)args->VirtualKey, args->KeyStatus.ScanCode);
   1.450  #if 0
   1.451      SDL_Keycode keycode = SDL_GetKeyFromScancode(sdlScancode);
   1.452      SDL_Log("key up, handled=%s, ext?=%s, released?=%s, menu key down?=%s, "