]> git.saurik.com Git - apple/xnu.git/blame - iokit/Drivers/hidsystem/drvApplePS2Keyboard/ApplePS2Keyboard.cpp
xnu-124.13.tar.gz
[apple/xnu.git] / iokit / Drivers / hidsystem / drvApplePS2Keyboard / ApplePS2Keyboard.cpp
CommitLineData
1c79356b
A
1/*
2 * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * The contents of this file constitute Original Code as defined in and
7 * are subject to the Apple Public Source License Version 1.1 (the
8 * "License"). You may not use this file except in compliance with the
9 * License. Please obtain a copy of the License at
10 * http://www.apple.com/publicsource and read it before using this file.
11 *
12 * This Original Code and all software distributed under the License are
13 * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
14 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
15 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
17 * License for the specific language governing rights and limitations
18 * under the License.
19 *
20 * @APPLE_LICENSE_HEADER_END@
21 */
22
23#include <IOKit/assert.h>
24#include <IOKit/IOLib.h>
25#include <IOKit/hidsystem/IOHIDTypes.h>
26#include <IOKit/hidsystem/IOLLEvent.h>
27#include "ApplePS2Keyboard.h"
28
29// =============================================================================
30// ApplePS2Keyboard Class Implementation
31//
32
33#define super IOHIKeyboard
34OSDefineMetaClassAndStructors(ApplePS2Keyboard, IOHIKeyboard);
35
36UInt32 ApplePS2Keyboard::deviceType() { return NX_EVS_DEVICE_TYPE_KEYBOARD; };
37UInt32 ApplePS2Keyboard::interfaceID() { return NX_EVS_DEVICE_INTERFACE_ACE; };
38
39UInt32 ApplePS2Keyboard::maxKeyCodes() { return KBV_NUM_KEYCODES; };
40
41// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
42
43bool ApplePS2Keyboard::init(OSDictionary * properties)
44{
45 //
46 // Initialize this object's minimal state. This is invoked right after this
47 // object is instantiated.
48 //
49
50 if (!super::init(properties)) return false;
51
52 _device = 0;
53 _extendCount = 0;
54 _interruptHandlerInstalled = false;
55 _ledState = 0;
56
57 for (int index = 0; index < KBV_NUNITS; index++) _keyBitVector[index] = 0;
58
59 return true;
60}
61
62// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
63
64ApplePS2Keyboard * ApplePS2Keyboard::probe(IOService * provider, SInt32 * score)
65{
66 //
67 // The driver has been instructed to verify the presence of the actual
68 // hardware we represent. We are guaranteed by the controller that the
69 // keyboard clock is enabled and the keyboard itself is disabled (thus
70 // it won't send any asynchronous scan codes that may mess up the
71 // responses expected by the commands we send it). This is invoked
72 // after the init.
73 //
74
75 ApplePS2KeyboardDevice * device = (ApplePS2KeyboardDevice *)provider;
76 PS2Request * request = device->allocateRequest();
77 bool success;
78
79 if (!super::probe(provider, score)) return 0;
80
81 //
82 // Check to see if the keyboard responds to a basic diagnostic echo.
83 //
84
85 // (diagnostic echo command)
86 request->commands[0].command = kPS2C_WriteDataPort;
87 request->commands[0].inOrOut = kDP_TestKeyboardEcho;
88 request->commands[1].command = kPS2C_ReadDataPortAndCompare;
89 request->commands[1].inOrOut = 0xEE;
90 request->commandsCount = 2;
91 device->submitRequestAndBlock(request);
92
93 // (free the request)
94 success = (request->commandsCount == 2);
95 device->freeRequest(request);
96
97 return (success) ? this : 0;
98}
99
100// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
101
102bool ApplePS2Keyboard::start(IOService * provider)
103{
104 //
105 // The driver has been instructed to start. This is called after a
106 // successful attach.
107 //
108
109 if (!super::start(provider)) return false;
110
111 //
112 // Maintain a pointer to and retain the provider object.
113 //
114
115 _device = (ApplePS2KeyboardDevice *)provider;
116 _device->retain();
117
118 //
119 // Install our driver's interrupt handler, for asynchronous data delivery.
120 //
121
122 _device->installInterruptAction(this,
123 (PS2InterruptAction)&ApplePS2Keyboard::interruptOccurred);
124 _interruptHandlerInstalled = true;
125
126 //
127 // Initialize the keyboard LED state.
128 //
129
130 setLEDs(_ledState);
131
132 //
133 // Enable the keyboard clock (should already be so), the keyboard IRQ line,
134 // and the keyboard Kscan -> scan code translation mode.
135 //
136
137 setCommandByte(kCB_EnableKeyboardIRQ | kCB_TranslateMode,
138 kCB_DisableKeyboardClock);
139
140 //
141 // Finally, we enable the keyboard itself, so that it may start reporting
142 // key events.
143 //
144
145 setKeyboardEnable(true);
146
147 return true;
148}
149
150// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
151
152void ApplePS2Keyboard::stop(IOService * provider)
153{
154 //
155 // The driver has been instructed to stop. Note that we must break all
156 // connections to other service objects now (ie. no registered actions,
157 // no pointers and retains to objects, etc), if any.
158 //
159
160 assert(_device == provider);
161
162 //
163 // Disable the keyboard itself, so that it may stop reporting key events.
164 //
165
166 setKeyboardEnable(false);
167
168 //
169 // Disable the keyboard clock and the keyboard IRQ line.
170 //
171
172 setCommandByte(kCB_DisableKeyboardClock, kCB_EnableKeyboardIRQ);
173
174 //
175 // Uninstall the interrupt handler.
176 //
177
178 if ( _interruptHandlerInstalled ) _device->uninstallInterruptAction();
179 _interruptHandlerInstalled = false;
180
181 //
182 // Release the pointer to the provider object.
183 //
184
185 _device->release();
186 _device = 0;
187
188 super::stop(provider);
189}
190
191// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
192
193void ApplePS2Keyboard::interruptOccurred(UInt8 scanCode) // PS2InterruptAction
194{
195 //
196 // This will be invoked automatically from our device when asynchronous
197 // keyboard data needs to be delivered. Process the keyboard data. Do
198 // NOT send any BLOCKING commands to our device in this context.
199 //
200
201 if (scanCode == kSC_Acknowledge)
202 IOLog("%s: Unexpected acknowledge from PS/2 controller.\n", getName());
203 else if (scanCode == kSC_Resend)
204 IOLog("%s: Unexpected resend request from PS/2 controller.\n", getName());
205 else
206 dispatchKeyboardEventWithScancode(scanCode);
207}
208
209// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
210
211bool ApplePS2Keyboard::dispatchKeyboardEventWithScancode(UInt8 scanCode)
212{
213 //
214 // Parses the given scan code, updating all necessary internal state, and
215 // should a new key be detected, the key event is dispatched.
216 //
217 // Returns true if a key event was indeed dispatched.
218 //
219
220 unsigned int keyCode;
221 bool goingDown;
222 AbsoluteTime now;
223
224 //
225 // See if this scan code introduces an extended key sequence. If so, note
226 // it and then return. Next time we get a key we'll finish the sequence.
227 //
228
229 if (scanCode == kSC_Extend)
230 {
231 _extendCount = 1;
232 return false;
233 }
234
235 //
236 // See if this scan code introduces an extended key sequence for the Pause
237 // Key. If so, note it and then return. The next time we get a key, drop
238 // it. The next key we get after that finishes the Pause Key sequence.
239 //
240 // The sequence actually sent to us by the keyboard for the Pause Key is:
241 //
242 // 1. E1 Extended Sequence for Pause Key
243 // 2. 1D Useless Data, with Up Bit Cleared
244 // 3. 45 Pause Key, with Up Bit Cleared
245 // 4. E1 Extended Sequence for Pause Key
246 // 5. 9D Useless Data, with Up Bit Set
247 // 6. C5 Pause Key, with Up Bit Set
248 //
249 // The reason items 4 through 6 are sent with the Pause Key is because the
250 // keyboard hardware never generates a release code for the Pause Key and
251 // the designers are being smart about it. The sequence above translates
252 // to this parser as two separate events, as it should be -- one down key
253 // event and one up key event (for the Pause Key).
254 //
255
256 if (scanCode == kSC_Pause)
257 {
258 _extendCount = 2;
259 return false;
260 }
261
262 //
263 // Convert the scan code into a key code.
264 //
265
266 if (_extendCount == 0)
267 keyCode = scanCode & ~kSC_UpBit;
268 else
269 {
270 _extendCount--;
271 if (_extendCount) return false;
272
273 //
274 // Convert certain extended codes on the PC keyboard into single scancodes.
275 // Refer to the conversion table in defaultKeymapOfLength.
276 //
277
278 switch (scanCode & ~kSC_UpBit)
279 {
280 case 0x1D: keyCode = 0x60; break; // ctrl
281 case 0x38: keyCode = 0x61; break; // alt
282 case 0x1C: keyCode = 0x62; break; // enter
283 case 0x35: keyCode = 0x63; break; // /
284 case 0x48: keyCode = 0x64; break; // up arrow
285 case 0x50: keyCode = 0x65; break; // down arrow
286 case 0x4B: keyCode = 0x66; break; // left arrow
287 case 0x4D: keyCode = 0x67; break; // right arrow
288 case 0x52: keyCode = 0x68; break; // insert
289 case 0x53: keyCode = 0x69; break; // delete
290 case 0x49: keyCode = 0x6A; break; // page up
291 case 0x51: keyCode = 0x6B; break; // page down
292 case 0x47: keyCode = 0x6C; break; // home
293 case 0x4F: keyCode = 0x6D; break; // end
294 case 0x37: keyCode = 0x6E; break; // PrintScreen
295 case 0x45: keyCode = 0x6F; break; // Pause
296 case 0x5B: keyCode = 0x70; break; // Left Windows
297 case 0x5C: keyCode = 0x71; break; // Right Windows
298 case 0x5D: keyCode = 0x72; break; // Application
299 case 0x2A: // header or trailer for PrintScreen
300 default: return false;
301 }
302 }
303
304 if (keyCode == 0) return false;
305
306 //
307 // Update our key bit vector, which maintains the up/down status of all keys.
308 //
309
310 goingDown = !(scanCode & kSC_UpBit);
311
312 if (goingDown)
313 {
314 //
315 // Verify that this is not an autorepeated key -- discard it if it is.
316 //
317
318 if (KBV_IS_KEYDOWN(keyCode, _keyBitVector)) return false;
319
320 KBV_KEYDOWN(keyCode, _keyBitVector);
321 }
322 else
323 {
324 KBV_KEYUP(keyCode, _keyBitVector);
325 }
326
327 //
328 // We have a valid key event -- dispatch it to our superclass.
329 //
330
331 clock_get_uptime(&now);
332
333 dispatchKeyboardEvent(keyCode, /*direction*/ goingDown, /*timeStamp*/ now);
334
335 return true;
336}
337
338// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
339
340void ApplePS2Keyboard::setAlphaLockFeedback(bool locked)
341{
342 //
343 // Set the keyboard LEDs to reflect the state of alpha (caps) lock.
344 //
345 // It is safe to issue this request from the interrupt/completion context.
346 //
347
348 _ledState = locked ? (_ledState | kLED_CapsLock):(_ledState & ~kLED_CapsLock);
349 setLEDs(_ledState);
350}
351
352// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
353
354void ApplePS2Keyboard::setLEDs(UInt8 ledState)
355{
356 //
357 // Asynchronously instructs the controller to set the keyboard LED state.
358 //
359 // It is safe to issue this request from the interrupt/completion context.
360 //
361
362 PS2Request * request = _device->allocateRequest();
363
364 // (set LEDs command)
365 request->commands[0].command = kPS2C_WriteDataPort;
366 request->commands[0].inOrOut = kDP_SetKeyboardLEDs;
367 request->commands[1].command = kPS2C_ReadDataPortAndCompare;
368 request->commands[1].inOrOut = kSC_Acknowledge;
369 request->commands[2].command = kPS2C_WriteDataPort;
370 request->commands[2].inOrOut = ledState;
371 request->commands[3].command = kPS2C_ReadDataPortAndCompare;
372 request->commands[3].inOrOut = kSC_Acknowledge;
373 request->commandsCount = 4;
374 _device->submitRequest(request); // asynchronous, auto-free'd
375}
376
377// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
378
379void ApplePS2Keyboard::setKeyboardEnable(bool enable)
380{
381 //
382 // Instructs the keyboard to start or stop the reporting of key events.
383 // Be aware that while the keyboard is enabled, asynchronous key events
384 // may arrive in the middle of command sequences sent to the controller,
385 // and may get confused for expected command responses.
386 //
387 // It is safe to issue this request from the interrupt/completion context.
388 //
389
390 PS2Request * request = _device->allocateRequest();
391
392 // (keyboard enable/disable command)
393 request->commands[0].command = kPS2C_WriteDataPort;
394 request->commands[0].inOrOut = (enable)?kDP_Enable:kDP_SetDefaultsAndDisable;
395 request->commands[1].command = kPS2C_ReadDataPortAndCompare;
396 request->commands[1].inOrOut = kSC_Acknowledge;
397 request->commandsCount = 2;
398 _device->submitRequest(request); // asynchronous, auto-free'd
399}
400
401// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
402
403void ApplePS2Keyboard::setCommandByte(UInt8 setBits, UInt8 clearBits)
404{
405 //
406 // Sets the bits setBits and clears the bits clearBits "atomically" in the
407 // controller's Command Byte. Since the controller does not provide such
408 // a read-modify-write primitive, we resort to a test-and-set try loop.
409 //
410 // Do NOT issue this request from the interrupt/completion context.
411 //
412
413 UInt8 commandByte;
414 UInt8 commandByteNew;
415 PS2Request * request = _device->allocateRequest();
416
417 do
418 {
419 // (read command byte)
420 request->commands[0].command = kPS2C_WriteCommandPort;
421 request->commands[0].inOrOut = kCP_GetCommandByte;
422 request->commands[1].command = kPS2C_ReadDataPort;
423 request->commands[1].inOrOut = 0;
424 request->commandsCount = 2;
425 _device->submitRequestAndBlock(request);
426
427 //
428 // Modify the command byte as requested by caller.
429 //
430
431 commandByte = request->commands[1].inOrOut;
432 commandByteNew = (commandByte | setBits) & (~clearBits);
433
434 // ("test-and-set" command byte)
435 request->commands[0].command = kPS2C_WriteCommandPort;
436 request->commands[0].inOrOut = kCP_GetCommandByte;
437 request->commands[1].command = kPS2C_ReadDataPortAndCompare;
438 request->commands[1].inOrOut = commandByte;
439 request->commands[2].command = kPS2C_WriteCommandPort;
440 request->commands[2].inOrOut = kCP_SetCommandByte;
441 request->commands[3].command = kPS2C_WriteDataPort;
442 request->commands[3].inOrOut = commandByteNew;
443 request->commandsCount = 4;
444 _device->submitRequestAndBlock(request);
445
446 //
447 // Repeat this loop if last command failed, that is, if the old command byte
448 // was modified since we first read it.
449 //
450
451 } while (request->commandsCount != 4);
452
453 _device->freeRequest(request);
454}
455
456// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
457
458const unsigned char * ApplePS2Keyboard::defaultKeymapOfLength(UInt32 * length)
459{
460 //
461 // Returns the default x86 keymap string.
462 //
463 // The following keys are multi-byte sequences on the x86 keyboard. They get
464 // mapped into a single scan code for our purposes. Here is the mapping:
465 // PC Key PC Code NeXT Code
466 // Right-Ctrl E0-1D 0x60
467 // Right-Alt E0-38 0x61
468 // Keypad-Enter E0-1C 0x62
469 // Keypad-/ E0-35 0x63
470 // Up-Arrow E0-48 0x64
471 // Down-Arrow E0-50 0x65
472 // Left-Arrow E0-4B 0x66
473 // Right-Arrow E0-4D 0x67
474 // Insert E0-52 0x68
475 // Delete E0-53 0x69
476 // Page Up E0-49 0x6A
477 // Page Down E0-51 0x6B
478 // Home E0-47 0x6C
479 // End E0-4F 0x6D
480 //
481 // Because there is no Command key on the x86 keyboard, we've split the ALT
482 // keys up. We'll use Left-Alt as Command, and Right-Alt as ALT.
483 //
484
485 #define CTRL(c) ((c)&037)
486 #define NX_MODIFIERKEY_ALPHALOCK 0
487 #define NX_MODIFIERKEY_SHIFT 1
488 #define NX_MODIFIERKEY_CONTROL 2
489 #define NX_MODIFIERKEY_ALTERNATE 3
490 #define NX_MODIFIERKEY_COMMAND 4
491 #define NX_MODIFIERKEY_NUMERICPAD 5
492 #define NX_MODIFIERKEY_HELP 6
493
494 static const unsigned char defaultKeymapForPC[] =
495 {
496 0x00, 0x00, // char file format
497
498 6, // MODIFIER KEY DEFINITIONS (6)
499 0x01, 0x02, 0x2A, 0x36, // Shift, 2 keys
500 0x02, 0x02, 0x1D, 0x60, // Ctrl, 2 keys
501 0x03, 0x01, 0x61, // Alt, 1 key
502 0x04, 0x01, 0x38, // Cmd, 1 key
503 0x05, 0x15, 0x52, 0x53, 0x62, 0x4F, 0x50, 0x51, 0x4B, 0x4C, 0x4D,
504 0x4E, 0x47, 0x48, 0x49, 0x45, 0x63, 0x37, 0x4A,
505 0x64, 0x65, 0x66, 0x67, // NumPad, 21 keys
506 0x06, 0x01, 0x3B, // Help, 1 key
507
508 104, // KEY DEFINITIONS
509 0xff, // Key 0x00 unassigned
510 // Key 0x01 modifier key mask bits (0x02)
511 (1<<NX_MODIFIERKEY_SHIFT),
512 NX_ASCIISET, CTRL('['), // no flags
513 NX_ASCIISET, '~', // Shift
514 // Key 0x02 modifier key mask bits (0x0a)
515 (1<<NX_MODIFIERKEY_SHIFT)|(1<<NX_MODIFIERKEY_ALTERNATE),
516 NX_ASCIISET, '1', // no flags
517 NX_ASCIISET, '!', // Shift
518 NX_SYMBOLSET, 0xad, // Alt
519 NX_ASCIISET, 0xa1, // Shift Alt
520 // Key 0x03 modifier key mask bits (0x0e)
521 (1<<NX_MODIFIERKEY_SHIFT)|(1<<NX_MODIFIERKEY_CONTROL)|
522 (1<<NX_MODIFIERKEY_ALTERNATE),
523 NX_ASCIISET, '2', // no flags
524 NX_ASCIISET, '@', // Shift
525 NX_ASCIISET, CTRL('@'), // Ctrl
526 NX_ASCIISET, CTRL('@'), // Shift Ctrl
527 NX_ASCIISET, 0xb2, // Alt
528 NX_ASCIISET, 0xb3, // Shift Alt
529 NX_ASCIISET, CTRL('@'), // Ctrl Alt
530 NX_ASCIISET, CTRL('@'), // Shift Ctrl Alt
531 // Key 0x04 modifier key mask bits (0x0a)
532 (1<<NX_MODIFIERKEY_SHIFT)|(1<<NX_MODIFIERKEY_ALTERNATE),
533 NX_ASCIISET, '3', // no flags
534 NX_ASCIISET, '#', // Shift
535 NX_ASCIISET, 0xa3, // Alt
536 NX_SYMBOLSET, 0xba, // Shift Alt
537 // Key 0x05 modifier key mask bits (0x0a)
538 (1<<NX_MODIFIERKEY_SHIFT)|(1<<NX_MODIFIERKEY_ALTERNATE),
539 NX_ASCIISET, '4', // no flags
540 NX_ASCIISET, '$', // Shift
541 NX_ASCIISET, 0xa2, // Alt
542 NX_ASCIISET, 0xa8, // Shift Alt
543 // Key 0x06 modifier key mask bits (0x0a)
544 (1<<NX_MODIFIERKEY_SHIFT)|(1<<NX_MODIFIERKEY_ALTERNATE),
545 NX_ASCIISET, '5', // no flags
546 NX_ASCIISET, '%', // Shift
547 NX_SYMBOLSET, 0xa5, // Alt
548 NX_ASCIISET, 0xbd, // Shift Alt
549 // Key 0x07 modifier key mask bits (0x0e)
550 (1<<NX_MODIFIERKEY_SHIFT)|(1<<NX_MODIFIERKEY_CONTROL)|
551 (1<<NX_MODIFIERKEY_ALTERNATE),
552 NX_ASCIISET, '6', // no flags
553 NX_ASCIISET, '^', // Shift
554 NX_ASCIISET, CTRL('^'), // Ctrl
555 NX_ASCIISET, CTRL('^'), // Shift Ctrl
556 NX_ASCIISET, 0xb6, // Alt
557 NX_ASCIISET, 0xc3, // Shift Alt
558 NX_ASCIISET, CTRL('^'), // Ctrl Alt
559 NX_ASCIISET, CTRL('^'), // Shift Ctrl Alt
560 // Key 0x08 modifier key mask bits (0x0a)
561 (1<<NX_MODIFIERKEY_SHIFT)|(1<<NX_MODIFIERKEY_ALTERNATE),
562 NX_ASCIISET, '7', // no flags
563 NX_ASCIISET, '&', // Shift
564 NX_ASCIISET, 0xb7, // Alt
565 NX_SYMBOLSET, 0xab, // Shift Alt
566 // Key 0x09 modifier key mask bits (0x0a)
567 (1<<NX_MODIFIERKEY_SHIFT)|(1<<NX_MODIFIERKEY_ALTERNATE),
568 NX_ASCIISET, '8', // no flags
569 NX_ASCIISET, '*', // Shift
570 NX_SYMBOLSET, 0xb0, // Alt
571 NX_ASCIISET, 0xb4, // Shift Alt
572 // Key 0x0A modifier key mask bits (0x0a)
573 (1<<NX_MODIFIERKEY_SHIFT)|(1<<NX_MODIFIERKEY_ALTERNATE),
574 NX_ASCIISET, '9', // no flags
575 NX_ASCIISET, '(', // Shift
576 NX_ASCIISET, 0xac, // Alt
577 NX_ASCIISET, 0xab, // Shift Alt
578 // Key 0x0B modifier key mask bits (0x0a)
579 (1<<NX_MODIFIERKEY_SHIFT)|(1<<NX_MODIFIERKEY_ALTERNATE),
580 NX_ASCIISET, '0', // no flags
581 NX_ASCIISET, ')', // Shift
582 NX_ASCIISET, 0xad, // Alt
583 NX_ASCIISET, 0xbb, // Shift Alt
584 // Key 0x0C modifier key mask bits (0x0e)
585 (1<<NX_MODIFIERKEY_SHIFT)|(1<<NX_MODIFIERKEY_CONTROL)|
586 (1<<NX_MODIFIERKEY_ALTERNATE),
587 NX_ASCIISET, '-', // no flags
588 NX_ASCIISET, '_', // Shift
589 NX_ASCIISET, CTRL('_'), // Ctrl
590 NX_ASCIISET, CTRL('_'), // Shift Ctrl
591 NX_ASCIISET, 0xb1, // Alt
592 NX_ASCIISET, 0xd0, // Shift Alt
593 NX_ASCIISET, CTRL('_'), // Ctrl Alt
594 NX_ASCIISET, CTRL('_'), // Shift Ctrl Alt
595 // Key 0x0D modifier key mask bits (0x0a)
596 (1<<NX_MODIFIERKEY_SHIFT)|(1<<NX_MODIFIERKEY_ALTERNATE),
597 NX_ASCIISET, '=', // no flags
598 NX_ASCIISET, '+', // Shift
599 NX_SYMBOLSET, 0xb9, // Alt
600 NX_SYMBOLSET, 0xb1, // Shift Alt
601 // Key 0x0E modifier key mask bits (0x02)
602 (1<<NX_MODIFIERKEY_SHIFT),
603 NX_ASCIISET, 0x7f, // no flags
604 NX_ASCIISET, '\b', // Shift
605 // Key 0x0f modifier key mask bits (0x02)
606 (1<<NX_MODIFIERKEY_SHIFT),
607 NX_ASCIISET, '\t', // no flags
608 NX_ASCIISET, CTRL('Y'), // Shift
609 // Key 0x10 modifier key mask bits (0x0d)
610 (1<<NX_MODIFIERKEY_ALPHALOCK)|(1<<NX_MODIFIERKEY_CONTROL)|
611 (1<<NX_MODIFIERKEY_ALTERNATE),
612 NX_ASCIISET, 'q', // no flags
613 NX_ASCIISET, 'Q', // AlphaShift
614 NX_ASCIISET, CTRL('Q'), // Ctrl
615 NX_ASCIISET, CTRL('Q'), // AlphaShift Ctrl
616 NX_ASCIISET, 0xfa, // Alt
617 NX_ASCIISET, 0xea, // AlphaShift Alt
618 NX_ASCIISET, CTRL('Q'), // Ctrl Alt
619 NX_ASCIISET, CTRL('Q'), // AlphaShift Ctrl Alt
620 // Key 0x11 modifier key mask bits (0x0d)
621 (1<<NX_MODIFIERKEY_ALPHALOCK)|(1<<NX_MODIFIERKEY_CONTROL)|
622 (1<<NX_MODIFIERKEY_ALTERNATE),
623 NX_ASCIISET, 'w', // no flags
624 NX_ASCIISET, 'W', // AlphaShift
625 NX_ASCIISET, CTRL('W'), // Ctrl
626 NX_ASCIISET, CTRL('W'), // AlphaShift Ctrl
627 NX_SYMBOLSET, 0xc8, // Alt
628 NX_SYMBOLSET, 0xc7, // AlphaShift Alt
629 NX_ASCIISET, CTRL('W'), // Ctrl Alt
630 NX_ASCIISET, CTRL('W'), // AlphaShift Ctrl Alt
631 // Key 0x12 modifier key mask bits (0x0d)
632 (1<<NX_MODIFIERKEY_ALPHALOCK)|(1<<NX_MODIFIERKEY_CONTROL)|
633 (1<<NX_MODIFIERKEY_ALTERNATE),
634 NX_ASCIISET, 'e', // no flags
635 NX_ASCIISET, 'E', // AlphaShift
636 NX_ASCIISET, CTRL('E'), // Ctrl
637 NX_ASCIISET, CTRL('E'), // AlphaShift Ctrl
638 NX_ASCIISET, 0xc2, // Alt
639 NX_ASCIISET, 0xc5, // AlphaShift Alt
640 NX_ASCIISET, CTRL('E'), // Ctrl Alt
641 NX_ASCIISET, CTRL('E'), // AlphaShift Ctrl Alt
642 // Key 0x13 modifier key mask bits (0x0d)
643 (1<<NX_MODIFIERKEY_ALPHALOCK)|(1<<NX_MODIFIERKEY_CONTROL)|
644 (1<<NX_MODIFIERKEY_ALTERNATE),
645 NX_ASCIISET, 'r', // no flags
646 NX_ASCIISET, 'R', // AlphaShift
647 NX_ASCIISET, CTRL('R'), // Ctrl
648 NX_ASCIISET, CTRL('R'), // AlphaShift Ctrl
649 NX_SYMBOLSET, 0xe2, // Alt
650 NX_SYMBOLSET, 0xd2, // AlphaShift Alt
651 NX_ASCIISET, CTRL('R'), // Ctrl Alt
652 NX_ASCIISET, CTRL('R'), // AlphaShift Ctrl Alt
653 // Key 0x14 modifier key mask bits (0x0d)
654 (1<<NX_MODIFIERKEY_ALPHALOCK)|(1<<NX_MODIFIERKEY_CONTROL)|
655 (1<<NX_MODIFIERKEY_ALTERNATE),
656 NX_ASCIISET, 't', // no flags
657 NX_ASCIISET, 'T', // AlphaShift
658 NX_ASCIISET, CTRL('T'), // Ctrl
659 NX_ASCIISET, CTRL('T'), // AlphaShift Ctrl
660 NX_SYMBOLSET, 0xe4, // Alt
661 NX_SYMBOLSET, 0xd4, // AlphaShift Alt
662 NX_ASCIISET, CTRL('T'), // Ctrl Alt
663 NX_ASCIISET, CTRL('T'), // AlphaShift Ctrl Alt
664 // Key 0x15 modifier key mask bits (0x0d)
665 (1<<NX_MODIFIERKEY_ALPHALOCK)|(1<<NX_MODIFIERKEY_CONTROL)|
666 (1<<NX_MODIFIERKEY_ALTERNATE),
667 NX_ASCIISET, 'y', // no flags
668 NX_ASCIISET, 'Y', // AlphaShift
669 NX_ASCIISET, CTRL('Y'), // Ctrl
670 NX_ASCIISET, CTRL('Y'), // AlphaShift Ctrl
671 NX_ASCIISET, 0xa5, // Alt
672 NX_SYMBOLSET, 0xdb, // AlphaShift Alt
673 NX_ASCIISET, CTRL('Y'), // Ctrl Alt
674 NX_ASCIISET, CTRL('Y'), // AlphaShift Ctrl Alt
675 // Key 0x16 modifier key mask bits (0x0d)
676 (1<<NX_MODIFIERKEY_ALPHALOCK)|(1<<NX_MODIFIERKEY_CONTROL)|
677 (1<<NX_MODIFIERKEY_ALTERNATE),
678 NX_ASCIISET, 'u', // no flags
679 NX_ASCIISET, 'U', // AlphaShift
680 NX_ASCIISET, CTRL('U'), // Ctrl
681 NX_ASCIISET, CTRL('U'), // AlphaShift Ctrl
682 NX_ASCIISET, 0xc8, // Alt
683 NX_ASCIISET, 0xcd, // AlphaShift Alt
684 NX_ASCIISET, CTRL('U'), // Ctrl Alt
685 NX_ASCIISET, CTRL('U'), // AlphaShift Ctrl Alt
686 // Key 0x17 modifier key mask bits (0x0d)
687 (1<<NX_MODIFIERKEY_ALPHALOCK)|(1<<NX_MODIFIERKEY_CONTROL)|
688 (1<<NX_MODIFIERKEY_ALTERNATE),
689 NX_ASCIISET, 'i', // no flags
690 NX_ASCIISET, 'I', // AlphaShift
691 NX_ASCIISET, '\t', // Ctrl
692 NX_ASCIISET, '\t', // AlphaShift Ctrl
693 NX_ASCIISET, 0xc1, // Alt
694 NX_ASCIISET, 0xf5, // AlphaShift Alt
695 NX_ASCIISET, '\t', // Ctrl Alt
696 NX_ASCIISET, '\t', // AlphaShift Ctrl Alt
697 // Key 0x18 modifier key mask bits (0x0d)
698 (1<<NX_MODIFIERKEY_ALPHALOCK)|(1<<NX_MODIFIERKEY_CONTROL)|
699 (1<<NX_MODIFIERKEY_ALTERNATE),
700 NX_ASCIISET, 'o', // no flags
701 NX_ASCIISET, 'O', // AlphaShift
702 NX_ASCIISET, CTRL('O'), // Ctrl
703 NX_ASCIISET, CTRL('O'), // AlphaShift Ctrl
704 NX_ASCIISET, 0xf9, // Alt
705 NX_ASCIISET, 0xe9, // AlphaShift Alt
706 NX_ASCIISET, CTRL('O'), // Ctrl Alt
707 NX_ASCIISET, CTRL('O'), // AlphaShift Ctrl Alt
708 // Key 0x19 modifier key mask bits (0x0d)
709 (1<<NX_MODIFIERKEY_ALPHALOCK)|(1<<NX_MODIFIERKEY_CONTROL)|
710 (1<<NX_MODIFIERKEY_ALTERNATE),
711 NX_ASCIISET, 'p', // no flags
712 NX_ASCIISET, 'P', // AlphaShift
713 NX_ASCIISET, CTRL('P'), // Ctrl
714 NX_ASCIISET, CTRL('P'), // AlphaShift Ctrl
715 NX_SYMBOLSET, 0x70, // Alt
716 NX_SYMBOLSET, 0x50, // AlphaShift Alt
717 NX_ASCIISET, CTRL('P'), // Ctrl Alt
718 NX_ASCIISET, CTRL('P'), // AlphaShift Ctrl Alt
719 // Key 0x1A modifier key mask bits (0x0e)
720 (1<<NX_MODIFIERKEY_SHIFT)|(1<<NX_MODIFIERKEY_CONTROL)|
721 (1<<NX_MODIFIERKEY_ALTERNATE),
722 NX_ASCIISET, '[', // no flags
723 NX_ASCIISET, '{', // Shift
724 NX_ASCIISET, CTRL('['), // Ctrl
725 NX_ASCIISET, CTRL('['), // Shift Ctrl
726 NX_ASCIISET, '`', // Alt
727 NX_ASCIISET, 0xaa, // Shift Alt
728 NX_ASCIISET, CTRL('['), // Ctrl Alt
729 NX_ASCIISET, CTRL('['), // Shift Ctrl Alt
730 // Key 0x1B modifier key mask bits (0x0e)
731 (1<<NX_MODIFIERKEY_SHIFT)|(1<<NX_MODIFIERKEY_CONTROL)|
732 (1<<NX_MODIFIERKEY_ALTERNATE),
733 NX_ASCIISET, ']', // no flags
734 NX_ASCIISET, '}', // Shift
735 NX_ASCIISET, CTRL(']'), // Ctrl
736 NX_ASCIISET, CTRL(']'), // Shift Ctrl
737 NX_ASCIISET, '\'', // Alt
738 NX_ASCIISET, 0xba, // Shift Alt
739 NX_ASCIISET, CTRL(']'), // Ctrl Alt
740 NX_ASCIISET, CTRL(']'), // Shift Ctrl Alt
741 // Key 0x1C modifier key mask bits (0x10)
742 (1<<NX_MODIFIERKEY_COMMAND),
743 NX_ASCIISET, '\r', // no flags
744 NX_ASCIISET, CTRL('C'), // Cmd
745 0xff, // Key 0x1D unassigned - Left Control
746 // Key 0x1E modifier key mask bits (0x0d)
747 (1<<NX_MODIFIERKEY_ALPHALOCK)|(1<<NX_MODIFIERKEY_CONTROL)|
748 (1<<NX_MODIFIERKEY_ALTERNATE),
749 NX_ASCIISET, 'a', // no flags
750 NX_ASCIISET, 'A', // AlphaShift
751 NX_ASCIISET, CTRL('A'), // Ctrl
752 NX_ASCIISET, CTRL('A'), // AlphaShift Ctrl
753 NX_ASCIISET, 0xca, // Alt
754 NX_ASCIISET, 0xc7, // AlphaShift Alt
755 NX_ASCIISET, CTRL('A'), // Ctrl Alt
756 NX_ASCIISET, CTRL('A'), // AlphaShift Ctrl Alt
757 // Key 0x1F modifier key mask bits (0x0d)
758 (1<<NX_MODIFIERKEY_ALPHALOCK)|(1<<NX_MODIFIERKEY_CONTROL)|
759 (1<<NX_MODIFIERKEY_ALTERNATE),
760 NX_ASCIISET, 's', // no flags
761 NX_ASCIISET, 'S', // AlphaShift
762 NX_ASCIISET, CTRL('S'), // Ctrl
763 NX_ASCIISET, CTRL('S'), // AlphaShift Ctrl
764 NX_ASCIISET, 0xfb, // Alt
765 NX_ASCIISET, 0xa7, // AlphaShift Alt
766 NX_ASCIISET, CTRL('S'), // Ctrl Alt
767 NX_ASCIISET, CTRL('S'), // AlphaShift Ctrl Alt
768 // Key 0x20 modifier key mask bits (0x0d)
769 (1<<NX_MODIFIERKEY_ALPHALOCK)|(1<<NX_MODIFIERKEY_CONTROL)|
770 (1<<NX_MODIFIERKEY_ALTERNATE),
771 NX_ASCIISET, 'd', // no flags
772 NX_ASCIISET, 'D', // AlphaShift
773 NX_ASCIISET, CTRL('D'), // Ctrl
774 NX_ASCIISET, CTRL('D'), // AlphaShift Ctrl
775 NX_SYMBOLSET, 0x44, // Alt
776 NX_SYMBOLSET, 0xb6, // AlphaShift Alt
777 NX_ASCIISET, CTRL('D'), // Ctrl Alt
778 NX_ASCIISET, CTRL('D'), // AlphaShift Ctrl Alt
779 // Key 0x21 modifier key mask bits (0x0d)
780 (1<<NX_MODIFIERKEY_ALPHALOCK)|(1<<NX_MODIFIERKEY_CONTROL)|
781 (1<<NX_MODIFIERKEY_ALTERNATE),
782 NX_ASCIISET, 'f', // no flags
783 NX_ASCIISET, 'F', // AlphaShift
784 NX_ASCIISET, CTRL('F'), // Ctrl
785 NX_ASCIISET, CTRL('F'), // AlphaShift Ctrl
786 NX_ASCIISET, 0xa6, // Alt
787 NX_SYMBOLSET, 0xac, // AlphaShift Alt
788 NX_ASCIISET, CTRL('F'), // Ctrl Alt
789 NX_ASCIISET, CTRL('F'), // AlphaShift Ctrl Alt
790 // Key 0x22 modifier key mask bits (0x0d)
791 (1<<NX_MODIFIERKEY_ALPHALOCK)|(1<<NX_MODIFIERKEY_CONTROL)|
792 (1<<NX_MODIFIERKEY_ALTERNATE),
793 NX_ASCIISET, 'g', // no flags
794 NX_ASCIISET, 'G', // AlphaShift
795 NX_ASCIISET, CTRL('G'), // Ctrl
796 NX_ASCIISET, CTRL('G'), // AlphaShift Ctrl
797 NX_ASCIISET, 0xf1, // Alt
798 NX_ASCIISET, 0xe1, // AlphaShift Alt
799 NX_ASCIISET, CTRL('G'), // Ctrl Alt
800 NX_ASCIISET, CTRL('G'), // AlphaShift Ctrl Alt
801 // Key 0x23 modifier key mask bits (0x0d)
802 (1<<NX_MODIFIERKEY_ALPHALOCK)|(1<<NX_MODIFIERKEY_CONTROL)|
803 (1<<NX_MODIFIERKEY_ALTERNATE),
804 NX_ASCIISET, 'h', // no flags
805 NX_ASCIISET, 'H', // AlphaShift
806 NX_ASCIISET, '\b', // Ctrl
807 NX_ASCIISET, '\b', // AlphaShift Ctrl
808 NX_ASCIISET, 0xe3, // Alt
809 NX_ASCIISET, 0xeb, // AlphaShift Alt
810 NX_ASCIISET, CTRL('@'), // Ctrl Alt
811 0x18, CTRL('@'), // AlphaShift Ctrl Alt
812 // Key 0x24 modifier key mask bits (0x0d)
813 (1<<NX_MODIFIERKEY_ALPHALOCK)|(1<<NX_MODIFIERKEY_CONTROL)|
814 (1<<NX_MODIFIERKEY_ALTERNATE),
815 NX_ASCIISET, 'j', // no flags
816 NX_ASCIISET, 'J', // AlphaShift
817 NX_ASCIISET, '\n', // Ctrl
818 NX_ASCIISET, '\n', // AlphaShift Ctrl
819 NX_ASCIISET, 0xc6, // Alt
820 NX_ASCIISET, 0xae, // AlphaShift Alt
821 NX_ASCIISET, '\n', // Ctrl Alt
822 NX_ASCIISET, '\n', // AlphaShift Ctrl Alt
823 // Key 0x25 modifier key mask bits (0x0d)
824 (1<<NX_MODIFIERKEY_ALPHALOCK)|(1<<NX_MODIFIERKEY_CONTROL)|
825 (1<<NX_MODIFIERKEY_ALTERNATE),
826 NX_ASCIISET, 'k', // no flags
827 NX_ASCIISET, 'K', // AlphaShift
828 NX_ASCIISET, CTRL('K'), // Ctrl
829 NX_ASCIISET, CTRL('K'), // AlphaShift Ctrl
830 NX_ASCIISET, 0xce, // Alt
831 NX_ASCIISET, 0xaf, // AlphaShift Alt
832 NX_ASCIISET, CTRL('K'), // Ctrl Alt
833 NX_ASCIISET, CTRL('K'), // AlphaShift Ctrl Alt
834 // Key 0x26 modifier key mask bits (0x0d)
835 (1<<NX_MODIFIERKEY_ALPHALOCK)|(1<<NX_MODIFIERKEY_CONTROL)|
836 (1<<NX_MODIFIERKEY_ALTERNATE),
837 NX_ASCIISET, 'l', // no flags
838 NX_ASCIISET, 'L', // AlphaShift
839 NX_ASCIISET, '\f', // Ctrl
840 NX_ASCIISET, '\f', // AlphaShift Ctrl
841 NX_ASCIISET, 0xf8, // Alt
842 NX_ASCIISET, 0xe8, // AlphaShift Alt
843 NX_ASCIISET, '\f', // Ctrl Alt
844 NX_ASCIISET, '\f', // AlphaShift Ctrl Alt
845 // Key 0x27 modifier key mask bits (0x0a)
846 (1<<NX_MODIFIERKEY_SHIFT)|(1<<NX_MODIFIERKEY_ALTERNATE),
847 NX_ASCIISET, ';', // no flags
848 NX_ASCIISET, ':', // Shift
849 NX_SYMBOLSET, 0xb2, // Alt
850 NX_SYMBOLSET, 0xa2, // Shift Alt
851 // Key 0x28 modifier key mask bits (0x0a)
852 (1<<NX_MODIFIERKEY_SHIFT)|(1<<NX_MODIFIERKEY_ALTERNATE),
853 NX_ASCIISET, '\'', // no flags
854 NX_ASCIISET, '"', // Shift
855 NX_ASCIISET, 0xa9, // Alt
856 NX_SYMBOLSET, 0xae, // Shift Alt
857 // Key 0x29 modifier key mask bits (0x02)
858 (1<<NX_MODIFIERKEY_SHIFT),
859 NX_ASCIISET, '`', // no flags
860 NX_ASCIISET, '~', // Shift
861 0xff, // Key 0x2A unassigned - Left Shift
862 // Key 0x2B modifier key mask bits (0x0e)
863 (1<<NX_MODIFIERKEY_SHIFT)|(1<<NX_MODIFIERKEY_CONTROL)|
864 (1<<NX_MODIFIERKEY_ALTERNATE),
865 NX_ASCIISET, '\\', // no flags
866 NX_ASCIISET, '|', // Shift
867 NX_ASCIISET, CTRL('\\'), // Ctrl
868 NX_ASCIISET, CTRL('\\'), // Shift Ctrl
869 NX_ASCIISET, 0xe3, // Alt
870 NX_ASCIISET, 0xeb, // Shift Alt
871 NX_ASCIISET, CTRL('\\'), // Ctrl Alt
872 NX_ASCIISET, CTRL('\\'), // Shift Ctrl Alt
873 // Key 0x2C modifier key mask bits (0x0d)
874 (1<<NX_MODIFIERKEY_ALPHALOCK)|(1<<NX_MODIFIERKEY_CONTROL)|
875 (1<<NX_MODIFIERKEY_ALTERNATE),
876 NX_ASCIISET, 'z', // no flags
877 NX_ASCIISET, 'Z', // AlphaShift
878 NX_ASCIISET, CTRL('Z'), // Ctrl
879 NX_ASCIISET, CTRL('Z'), // AlphaShift Ctrl
880 NX_ASCIISET, 0xcf, // Alt
881 NX_SYMBOLSET, 0x57, // AlphaShift Alt
882 NX_ASCIISET, CTRL('Z'), // Ctrl Alt
883 NX_ASCIISET, CTRL('Z'), // AlphaShift Ctrl Alt
884 // Key 0x2D modifier key mask bits (0x0d)
885 (1<<NX_MODIFIERKEY_ALPHALOCK)|(1<<NX_MODIFIERKEY_CONTROL)|
886 (1<<NX_MODIFIERKEY_ALTERNATE),
887 NX_ASCIISET, 'x', // no flags
888 NX_ASCIISET, 'X', // AlphaShift
889 NX_ASCIISET, CTRL('X'), // Ctrl
890 NX_ASCIISET, CTRL('X'), // AlphaShift Ctrl
891 NX_SYMBOLSET, 0xb4, // Alt
892 NX_SYMBOLSET, 0xce, // AlphaShift Alt
893 NX_ASCIISET, CTRL('X'), // Ctrl Alt
894 NX_ASCIISET, CTRL('X'), // AlphaShift Ctrl Alt
895 // Key 0x2E modifier key mask bits (0x0d)
896 (1<<NX_MODIFIERKEY_ALPHALOCK)|(1<<NX_MODIFIERKEY_CONTROL)|
897 (1<<NX_MODIFIERKEY_ALTERNATE),
898 NX_ASCIISET, 'c', // no flags
899 NX_ASCIISET, 'C', // AlphaShift
900 NX_ASCIISET, CTRL('C'), // Ctrl
901 NX_ASCIISET, CTRL('C'), // AlphaShift Ctrl
902 NX_SYMBOLSET, 0xe3, // Alt
903 NX_SYMBOLSET, 0xd3, // AlphaShift Alt
904 NX_ASCIISET, CTRL('C'), // Ctrl Alt
905 NX_ASCIISET, CTRL('C'), // AlphaShift Ctrl Alt
906 // Key 0x2F modifier key mask bits (0x0d)
907 (1<<NX_MODIFIERKEY_ALPHALOCK)|(1<<NX_MODIFIERKEY_CONTROL)|
908 (1<<NX_MODIFIERKEY_ALTERNATE),
909 NX_ASCIISET, 'v', // no flags
910 NX_ASCIISET, 'V', // AlphaShift
911 NX_ASCIISET, CTRL('V'), // Ctrl
912 NX_ASCIISET, CTRL('V'), // AlphaShift Ctrl
913 NX_SYMBOLSET, 0xd6, // Alt
914 NX_SYMBOLSET, 0xe0, // AlphaShift Alt
915 NX_ASCIISET, CTRL('V'), // Ctrl Alt
916 NX_ASCIISET, CTRL('V'), // AlphaShift Ctrl Alt
917 // Key 0x30 modifier key mask bits (0x0d)
918 (1<<NX_MODIFIERKEY_ALPHALOCK)|(1<<NX_MODIFIERKEY_CONTROL)|
919 (1<<NX_MODIFIERKEY_ALTERNATE),
920 NX_ASCIISET, 'b', // no flags
921 NX_ASCIISET, 'B', // AlphaShift
922 NX_ASCIISET, CTRL('B'), // Ctrl
923 NX_ASCIISET, CTRL('B'), // AlphaShift Ctrl
924 NX_SYMBOLSET, 0xe5, // Alt
925 NX_SYMBOLSET, 0xf2, // AlphaShift Alt
926 NX_ASCIISET, CTRL('B'), // Ctrl Alt
927 NX_ASCIISET, CTRL('B'), // AlphaShift Ctrl Alt
928 // Key 0x31 modifier key mask bits (0x0d)
929 (1<<NX_MODIFIERKEY_ALPHALOCK)|(1<<NX_MODIFIERKEY_CONTROL)|
930 (1<<NX_MODIFIERKEY_ALTERNATE),
931 NX_ASCIISET, 'n', // no flags
932 NX_ASCIISET, 'N', // AlphaShift
933 NX_ASCIISET, CTRL('N'), // Ctrl
934 NX_ASCIISET, CTRL('N'), // AlphaShift Ctrl
935 NX_ASCIISET, 0xc4, // Alt
936 NX_SYMBOLSET, 0xaf, // AlphaShift Alt
937 NX_ASCIISET, CTRL('N'), // Ctrl Alt
938 NX_ASCIISET, CTRL('N'), // AlphaShift Ctrl Alt
939 // Key 0x32 modifier key mask bits (0x0d)
940 (1<<NX_MODIFIERKEY_ALPHALOCK)|(1<<NX_MODIFIERKEY_CONTROL)|
941 (1<<NX_MODIFIERKEY_ALTERNATE),
942 NX_ASCIISET, 'm', // no flags
943 NX_ASCIISET, 'M', // AlphaShift
944 NX_ASCIISET, '\r', // Ctrl
945 NX_ASCIISET, '\r', // AlphaShift Ctrl
946 NX_SYMBOLSET, 0x6d, // Alt
947 NX_SYMBOLSET, 0xd8, // AlphaShift Alt
948 NX_ASCIISET, '\r', // Ctrl Alt
949 NX_ASCIISET, '\r', // AlphaShift Ctrl Alt
950 // Key 0x33 modifier key mask bits (0x0a)
951 (1<<NX_MODIFIERKEY_SHIFT)|(1<<NX_MODIFIERKEY_ALTERNATE),
952 NX_ASCIISET, ',', // no flags
953 NX_ASCIISET, '<', // Shift
954 NX_ASCIISET, 0xcb, // Alt
955 NX_SYMBOLSET, 0xa3, // Shift Alt
956 // Key 0x34 modifier key mask bits (0x0a)
957 (1<<NX_MODIFIERKEY_SHIFT)|(1<<NX_MODIFIERKEY_ALTERNATE),
958 NX_ASCIISET, '.', // no flags
959 NX_ASCIISET, '>', // Shift
960 NX_ASCIISET, 0xbc, // Alt
961 NX_SYMBOLSET, 0xb3, // Shift Alt
962 // Key 0x35 modifier key mask bits (0x0a)
963 (1<<NX_MODIFIERKEY_SHIFT)|(1<<NX_MODIFIERKEY_ALTERNATE),
964 NX_ASCIISET, '/', // no flags
965 NX_ASCIISET, '?', // Shift
966 NX_SYMBOLSET, 0xb8, // Alt
967 NX_ASCIISET, 0xbf, // Shift Alt
968 0xff, // Key 0x36 unassigned - Right Shift
969 // Key 0x37 modifier key mask bits (0x00)
970 0,
971 NX_ASCIISET, '*', // all
972 0xff, // Key 0x38 unassigned - Left Alt
973 // Key 0x39 modifier key mask bits (0x0c)
974 (1<<NX_MODIFIERKEY_CONTROL)|(1<<NX_MODIFIERKEY_ALTERNATE),
975 NX_ASCIISET, ' ', // no flags
976 NX_ASCIISET, CTRL('@'), // Ctrl
977 NX_ASCIISET, 0x80, // Alt
978 NX_ASCIISET, CTRL('@'), // Ctrl Alt
979 0xff, // Key 0x3A unassigned - CAPS LOCK
980 0xff, // Key 0x3B unassigned - F1
981 0xff, // Key 0x3C unassigned - F2
982 0xff, // Key 0x3D unassigned - F3
983 0xff, // Key 0x3E unassigned - F4
984 0xff, // Key 0x3F unassigned - F5
985 0xff, // Key 0x40 unassigned - F6
986 0xff, // Key 0x41 unassigned - F7
987 0xff, // Key 0x42 unassigned - F8
988 0xff, // Key 0x43 unassigned - F9
989 0xff, // Key 0x44 unassigned - F10
990 // Key 0x45 modifier key mask bits (0x0a)
991 (1<<NX_MODIFIERKEY_SHIFT)|(1<<NX_MODIFIERKEY_ALTERNATE),
992 NX_ASCIISET, '`', // no flags
993 NX_ASCIISET, '~', // Shift
994 NX_ASCIISET, '`', // Alt
995 NX_SYMBOLSET, 0xbb, // Shift Alt
996 0xff, // Key 0x46 unassigned
997 // Key 0x47 modifier key mask bits (0x00)
998 0,
999 NX_ASCIISET, '7', // all
1000 // Key 0x48 modifier key mask bits (0x00)
1001 0,
1002 NX_ASCIISET, '8', // all
1003 // Key 0x49 modifier key mask bits (0x00)
1004 0,
1005 NX_ASCIISET, '9', // all
1006 // Key 0x4A modifier key mask bits (0x00)
1007 0,
1008 NX_SYMBOLSET, 0x2d, // all
1009 // Key 0x4B modifier key mask bits (0x00)
1010 0,
1011 NX_ASCIISET, '4', // all
1012 // Key 0x4C modifier key mask bits (0x00)
1013 0,
1014 NX_ASCIISET, '5', // all
1015 // Key 0x4D modifier key mask bits (0x00)
1016 0,
1017 NX_ASCIISET, '6', // all
1018 // Key 0x4E modifier key mask bits (0x00)
1019 0,
1020 NX_ASCIISET, '+', // all
1021 // Key 0x4F modifier key mask bits (0x00)
1022 0,
1023 NX_ASCIISET, '1', // all
1024 // Key 0x50 modifier key mask bits (0x00)
1025 0,
1026 NX_ASCIISET, '2', // all
1027 // Key 0x51 modifier key mask bits (0x00)
1028 0,
1029 NX_ASCIISET, '3', // all
1030 // Key 0x52 modifier key mask bits (0x00)
1031 0,
1032 NX_ASCIISET, '0', // all
1033 // Key 0x53 modifier key mask bits (0x00)
1034 0,
1035 NX_ASCIISET, '.', // all
1036 0xff, // Key 0x54 unassigned
1037 0xff, // Key 0x55 unassigned
1038 0xff, // Key 0x56 unassigned
1039 0xff, // Key 0x57 unassigned - F11
1040 0xff, // Key 0x58 unassigned - F12
1041 0xff, // Key 0x59 unassigned
1042 0xff, // Key 0x5A unassigned
1043 0xff, // Key 0x5B unassigned
1044 0xff, // Key 0x5C unassigned
1045 0xff, // Key 0x5D unassigned
1046 0xff, // Key 0x5E unassigned
1047 0xff, // Key 0x5F unassigned
1048 0xff, // Key 0x60 unassigned - Right Ctrl
1049 0xff, // Key 0x61 unassigned - Right Alt
1050 // Key 0x62 modifier key mask bits (0x00)
1051 0,
1052 NX_ASCIISET, CTRL('C'), // all
1053 // Key 0x63 modifier key mask bits (0x0e)
1054 (1<<NX_MODIFIERKEY_SHIFT)|(1<<NX_MODIFIERKEY_CONTROL)|
1055 (1<<NX_MODIFIERKEY_ALTERNATE),
1056 NX_ASCIISET, '/', // no flags
1057 NX_ASCIISET, '\\', // Shift
1058 NX_ASCIISET, '/', // Ctrl
1059 NX_ASCIISET, CTRL('\\'), // Shift Ctrl
1060 NX_ASCIISET, '/', // Alt
1061 NX_ASCIISET, '\\', // Shift Alt
1062 NX_ASCIISET, CTRL('@'), // Ctrl Alt
1063 0x0a, CTRL('@'), // Shift Ctrl Alt
1064 // Key 0x64 modifier key mask bits (0x00)
1065 0,
1066 NX_SYMBOLSET, 0xad, // all
1067 // Key 0x65 modifier key mask bits (0x00)
1068 0,
1069 NX_SYMBOLSET, 0xaf, // all
1070 // Key 0x66 modifier key mask bits (0x00)
1071 0,
1072 NX_SYMBOLSET, 0xac, // all
1073 // Key 0x67 modifier key mask bits (0x00)
1074 0,
1075 NX_SYMBOLSET, 0xae, // all
1076 0, // Sequence Definitions
1077 9, // special keys
1078 0x00, 0x68, // Sound Up
1079 0x01, 0x69, // Sound Down
1080 0x02, 0x6A, // Brightness Up
1081 0x03, 0x6B, // Brightness Down
1082 0x04, 0x3A, // Caps Lock
1083 0x05, 0x3B, // Help Key
1084 0x06, 0x47, // Power Key
1085 0x07, 0x48, // Up Arrow
1086 0x08, 0x50 // Down Arrow
1087 };
1088
1089 *length = sizeof(defaultKeymapForPC);
1090 return defaultKeymapForPC;
1091}