# enter-option.fkx -- map ENTER on internal PowerBook keyboards to Option, # and do nothing else. # # Note that we have to explicitly program the Caps Lock key to act like a # Caps Lock key; read the ARCHITECTURE and Interpreter documents for more # about this. # # NOTE: SPECIAL events always get interpreted in the context of the # primary keyboard -- which is to say, the first keyboard that matches. # Want to see a lot of debugging? Use # #Debug: All Debug: Probe # Always ignore AppleADBButtons and SideTrack's "keyboard" device. Ignore: AppleADBButtons Ignore: SideTrackKeyboard #----------------------------------------------------------------------- Keyboard: Internal ADB PowerBook keyboard Class: AppleADBKeyboard # Don't check the type; any ADB keyboard on Tiger should be an internal # laptop keyboard, and should use these keycodes. Keys: ENTER: 52 CAPSLOCK: 57 LOPTION: 58 Normal: ENTER: Down: AddFlagOrDrop LeftOption SynthFlagChange LOPTION Drop Up: DropFlagOrDrop LeftOption SynthFlagChange LOPTION Drop CAPSLOCK: Flags: ToggleState 31 If Set 31 AddFlagOrDrop Caps Else DropFlagOrDrop Caps End SynthFlagChange CAPSLOCK Special: CAPSLOCK: Down: Pass Up: Pass #----------------------------------------------------------------------- # The internal USB PowerBook keyboard is an IOHIDKeyboard like a generic # external USB keyboard is. However, the internal USB keyboard has a # distinct provider... Keyboard: Internal USB PowerBook keyboard Class: IOHIDKeyboard Provider: AppleUSBTCKeyEventDriver # We've seen types 37 and 38 for PowerBook internal keyboards -- so just # match the provider and call it good. Type: * Keys: # For some strange reason, the keycode for ENTER is NOT the same # between the ADB and USB internal keyboards. Also, # unlike the ADB keyboard, the USB keyboard CAN differentiate # left & right modifiers -- so we'll borrow the keycode for the # external USB keyboard's right Option key and make ENTER a # proper right Option key. ENTER: 76 # NOT A TYPO! See above. CAPSLOCK: 57 ROPTION: 61 # Cheating: code from external USB keyboard Normal: ENTER: Down: AddFlagOrDrop RightOption SynthFlagChange ROPTION Drop Up: DropFlagOrDrop RightOption SynthFlagChange ROPTION Drop CAPSLOCK: Flags: ToggleState 31 If Set 31 AddFlagOrDrop Caps Else DropFlagOrDrop Caps End SynthFlagChange CAPSLOCK Special: CAPSLOCK: Down: Pass Up: Pass #----------------------------------------------------------------------- # Since we're only doing mappings on the internal keyboard, we're done.