Annotation of XNU/iokit/Drivers/hidsystem/drvAppleADBDevices/AppleADBKeyboard.h, revision 1.1.1.1

1.1       root        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: #include <IOKit/adb/IOADBDevice.h>
                     23: #include <IOKit/hidsystem/IOHIKeyboard.h>
                     24: 
                     25: class AppleADBKeyboard :  public IOHIKeyboard
                     26: {
                     27: OSDeclareDefaultStructors(AppleADBKeyboard)
                     28: 
                     29: private:
                     30:     
                     31: void setAlphaLockFeedback ( bool to );
                     32: UInt32 maxKeyCodes ( void );
                     33: const unsigned char * defaultKeymapOfLength (UInt32 * length );
                     34: UInt32 interfaceID ( void );
                     35: UInt32 deviceType ( void );
                     36: bool programmerKey;
                     37: AbsoluteTime  programmerKeyTime;
                     38: AbsoluteTime  rebootTime;
                     39: AbsoluteTime  debuggerTime;
                     40: 
                     41: public:
                     42: 
                     43: IOADBDevice *  adbDevice;
                     44: bool           turnLEDon;              // used by setAlphaLockFeedback mechanism
                     45: 
                     46: bool start ( IOService * theNub );
                     47: IOReturn packet (UInt8 * data, IOByteCount length, UInt8 adbCommand );
                     48: void dispatchKeyboardEvent(unsigned int keyCode,
                     49:                         /* direction */ bool         goingDown,
                     50:                         /* timeStamp */ AbsoluteTime   time);
                     51: };
                     52: 
                     53: /* 
                     54:  * Special key values
                     55:  */
                     56: 
                     57: #define ADBK_LEFT      0x3B
                     58: #define ADBK_RIGHT     0x3C
                     59: #define ADBK_UP                0x3E
                     60: #define ADBK_DOWN      0x3D
                     61: #define ADBK_PGUP      0x74
                     62: #define ADBK_PGDN      0x79
                     63: #define ADBK_HOME      0x73
                     64: #define ADBK_END       0x77
                     65: #define ADBK_CONTROL   0x36
                     66: #define ADBK_CONTROL_R  0x7D
                     67: #define ADBK_FLOWER    0x37
                     68: #define ADBK_SHIFT     0x38
                     69: #define ADBK_SHIFT_R    0x7B
                     70: #define ADBK_CAPSLOCK  0x39
                     71: #define ADBK_OPTION    0x3A
                     72: #define ADBK_OPTION_R   0x7C
                     73: #define        ADBK_NUMLOCK    0x47
                     74: #define ADBK_SPACE     0x31
                     75: #define ADBK_F         0x03
                     76: #define ADBK_O         0x1F
                     77: #define ADBK_P         0x23
                     78: #define ADBK_Q         0x0C
                     79: #define ADBK_V         0x09
                     80: #define ADBK_1         0x12
                     81: #define ADBK_2         0x13
                     82: #define ADBK_3         0x14
                     83: #define ADBK_4         0x15
                     84: #define ADBK_5         0x17
                     85: #define ADBK_6         0x16
                     86: #define ADBK_7         0x1A
                     87: #define ADBK_8         0x1C
                     88: #define ADBK_9         0x19
                     89: #define ADBK_0         0x1D
                     90: #define        ADBK_POWER      0x7f    /* actual 0x7f 0x7f */
                     91: 
                     92: #define ADBK_KEYVAL(key)       ((key) & 0x7f)
                     93: #define ADBK_PRESS(key)                (((key) & 0x80) == 0)
                     94: #define ADBK_KEYDOWN(key)      (key)
                     95: #define ADBK_KEYUP(key)                ((key) | 0x80)
                     96: #define ADBK_MODIFIER(key)     ((((key) & 0x7f) == ADBK_SHIFT) || \
                     97:                                 (((key) & 0x7f) == ADBK_SHIFT_R) || \
                     98:                                 (((key) & 0x7f) == ADBK_CONTROL) || \
                     99:                                 (((key) & 0x7f) == ADBK_CONTROL_R) || \
                    100:                                 (((key) & 0x7f) == ADBK_FLOWER) || \
                    101:                                 (((key) & 0x7f) == ADBK_OPTION) || \
                    102:                                 (((key) & 0x7f) == ADBK_OPTION_R) || \
                    103:                                 (((key) & 0x7f) == ADBK_NUMLOCK) || \
                    104:                                 (((key) & 0x7f) == ADBK_CAPSLOCK))
                    105: 
                    106: /* ADB Keyboard Status - ADB Register 2 */
                    107: 
                    108: #define        ADBKS_LED_NUMLOCK               0x0001
                    109: #define        ADBKS_LED_CAPSLOCK              0x0002
                    110: #define        ADBKS_LED_SCROLLLOCK            0x0004
                    111: #define        ADBKS_SCROLL_LOCK               0x0040
                    112: #define        ADBKS_NUMLOCK                   0x0080
                    113: /* Bits 3 to 5 are reserved */
                    114: #define        ADBKS_APPLE_CMD                 0x0100
                    115: #define        ADBKS_OPTION                    0x0200
                    116: #define        ADBKS_SHIFT                     0x0400
                    117: #define        ADBKS_CONTROL                   0x0800
                    118: #define        ADBKS_CAPSLOCK                  0x1000
                    119: #define        ADBKS_RESET                     0x2000
                    120: #define        ADBKS_DELETE                    0x4000
                    121: /* bit 16 is reserved */

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.