Annotation of Gnu-Mach/chips/lk201.h, revision 1.1

1.1     ! root        1: /* 
        !             2:  * Mach Operating System
        !             3:  * Copyright (c) 1991,1990 Carnegie Mellon University
        !             4:  * All Rights Reserved.
        !             5:  * 
        !             6:  * Permission to use, copy, modify and distribute this software and its
        !             7:  * documentation is hereby granted, provided that both the copyright
        !             8:  * notice and this permission notice appear in all copies of the
        !             9:  * software, derivative works or modified versions, and any portions
        !            10:  * thereof, and that both notices appear in supporting documentation.
        !            11:  * 
        !            12:  * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
        !            13:  * CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
        !            14:  * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
        !            15:  * 
        !            16:  * Carnegie Mellon requests users of this software to return to
        !            17:  * 
        !            18:  *  Software Distribution Coordinator  or  [email protected]
        !            19:  *  School of Computer Science
        !            20:  *  Carnegie Mellon University
        !            21:  *  Pittsburgh PA 15213-3890
        !            22:  * 
        !            23:  * any improvements or extensions that they make and grant Carnegie Mellon
        !            24:  * the rights to redistribute these changes.
        !            25:  */
        !            26: /*
        !            27:  *     File: lk201.h
        !            28:  *     Author: Alessandro Forin, Carnegie Mellon University
        !            29:  *     Date:   9/90
        !            30:  *
        !            31:  *     Definitions for the LK201 Keyboard Driver
        !            32:  */
        !            33: 
        !            34: /*
        !            35:  *     KeyCodes generated by the LK201 board
        !            36:  *     (labels as in the lk201-AA USA model)
        !            37:  */
        !            38: 
        !            39: #define        LK_MINCODE      0x56
        !            40:                                                        /* Function keys */
        !            41: #define        LK_F1           0x56            /* div 10 */
        !            42: #define        LK_F2           0x57
        !            43: #define        LK_F3           0x58
        !            44: #define        LK_F4           0x59
        !            45: #define        LK_F5           0x5a
        !            46: #define        LK_F6           0x64            /* div 11 */
        !            47: #define        LK_F7           0x65
        !            48: #define        LK_F8           0x66
        !            49: #define        LK_F9           0x67
        !            50: #define        LK_F10          0x68
        !            51: #define        LK_F11          0x71            /* div 12 */
        !            52: #define        LK_ESC          LK_F11
        !            53: #define        LK_F12          0x72
        !            54: #define        LK_BS           LK_F12
        !            55: #define        LK_F13          0x73
        !            56: #define        LK_LF           LK_F13
        !            57: #define        LK_F14          0x74
        !            58: #define        LK_HELP         0x7c            /* div 13 */
        !            59: #define        LK_DO           0x7d
        !            60: #define        LK_F17          0x80            /* div 14 */
        !            61: #define        LK_F18          0x81
        !            62: #define        LK_F19          0x82
        !            63: #define        LK_F20          0x83
        !            64:                                                        /* Editing keys */
        !            65: #define        LK_FIND         0x8a            /* div 9 */
        !            66: #define        LK_INSERT       0x8b
        !            67: #define        LK_REMOVE       0x8c
        !            68: #define        LK_SELECT       0x8d
        !            69: #define        LK_PREV_SCREEN  0x8e
        !            70: #define        LK_NEXT_SCREEN  0x8f
        !            71:                                                        /* Numeric keypad */
        !            72: #define        LK_KP_0         0x92            /* div 2 */
        !            73: #define        LK_KP_DOT       0x94
        !            74: #define        LK_KP_ENTER     0x95
        !            75: #define        LK_KP_1         0x96
        !            76: #define        LK_KP_2         0x97
        !            77: #define        LK_KP_3         0x98
        !            78: #define        LK_KP_4         0x99
        !            79: #define        LK_KP_5         0x9a
        !            80: #define        LK_KP_6         0x9b
        !            81: #define        LK_KP_COMMA     0x9c
        !            82: #define        LK_KP_7         0x9d
        !            83: #define        LK_KP_8         0x9e
        !            84: #define        LK_KP_9         0x9f
        !            85: #define        LK_KP_MINUS     0xa0
        !            86: #define        LK_KP_PF1       0xa1
        !            87: #define        LK_KP_PF2       0xa2
        !            88: #define        LK_KP_PF3       0xa3
        !            89: #define        LK_KP_PF4       0xa4
        !            90:                                                        /* Cursor keys */
        !            91: #define        LK_LEFT         0xa7            /* div 7 */
        !            92: #define        LK_RIGHT        0xa8
        !            93: #define        LK_DOWN         0xa9            /* div 8 */
        !            94: #define        LK_UP           0xaa
        !            95:                                                        /* Shift & Co. */
        !            96: #define        LK_R_SHIFT      0xab            /* lk401 */
        !            97: #define        LK_L_ALT        0xac            /* lk401 */
        !            98: #define        LK_R_COMPOSE    0xad            /* lk401 */
        !            99: #define        LK_SHIFT        0xae            /* div 6 */
        !           100: #define        LK_CNTRL        0xaf
        !           101: #define        LK_LOCK         0xb0            /* div 5 */
        !           102: #define        LK_ALT          0xb1
        !           103: #define        LK_R_ALT        0xb2            /* lk401 */
        !           104:                                                        /* Special codes */
        !           105: #define        LK_ALLUP        0xb3
        !           106: #define        LK_REPEAT       0xb4
        !           107: #define        LK_OUTPUT_ERR   0xb5
        !           108: #define        LK_INPUT_ERR    0xb6
        !           109: #define        LK_KDBLOCK_ACK  0xb7
        !           110: #define        LK_TESTMODE_ACK 0xb8
        !           111: #define        LK_PFX_KEYDOWN  0xb9
        !           112: #define        LK_MODECHG_ACK  0xba
        !           113:                                                        /* Delete & Co. */
        !           114: #define        LK_DEL          0xbc            /* div 3 */
        !           115: #define        LK_RETURN       0xbd            /* div 4 */
        !           116: #define        LK_TAB          0xbe
        !           117:                                                        /* Graphic keys */
        !           118: 
        !           119: #define        LK_TILDE        0xbf            /* div 2 */
        !           120: #define        LK_1            0xc0
        !           121: #define        LK_Q            0xc1
        !           122: #define        LK_A            0xc2
        !           123: #define        LK_Z            0xc3
        !           124: #define        LK_2            0xc5
        !           125: #define        LK_W            0xc6
        !           126: #define        LK_S            0xc7
        !           127: #define        LK_X            0xc8
        !           128: #define        LK_LESSGRT      0xc9
        !           129: #define        LK_3            0xcb
        !           130: #define        LK_E            0xcc
        !           131: #define        LK_D            0xcd
        !           132: #define        LK_C            0xce
        !           133: #define        LK_4            0xd0
        !           134: #define        LK_R            0xd1
        !           135: #define        LK_F            0xd2
        !           136: #define        LK_V            0xd3
        !           137: #define        LK_SP           0xd4
        !           138: #define        LK_5            0xd6
        !           139: #define        LK_T            0xd7
        !           140: #define        LK_G            0xd8
        !           141: #define        LK_B            0xd9
        !           142: #define        LK_6            0xdb
        !           143: #define        LK_Y            0xdc
        !           144: #define        LK_H            0xdd
        !           145: #define        LK_N            0xde
        !           146: #define        LK_7            0xe0            /* div 1 */
        !           147: #define        LK_U            0xe1
        !           148: #define        LK_J            0xe2
        !           149: #define        LK_M            0xe3
        !           150: #define        LK_8            0xe5
        !           151: #define        LK_I            0xe6
        !           152: #define        LK_K            0xe7
        !           153: #define        LK_DQUOTE       0xe8
        !           154: #define        LK_9            0xea
        !           155: #define        LK_O            0xeb
        !           156: #define        LK_L            0xec
        !           157: #define        LK_DOT          0xed
        !           158: #define        LK_0            0xef
        !           159: #define        LK_P            0xf0
        !           160: #define        LK_COLON        0xf2
        !           161: #define        LK_QMARK        0xf3
        !           162: #define        LK_PLUS         0xf5
        !           163: #define        LK_RBRACKET     0xf6
        !           164: #define        LK_VBAR         0xf7
        !           165: #define        LK_MINUS        0xf9
        !           166: #define        LK_LBRACKET     0xfa
        !           167: #define        LK_COMMA        0xfb
        !           168: 
        !           169: 
        !           170: /*
        !           171:  *     Commands to the keyboard processor
        !           172:  */
        !           173: 
        !           174: #define        LK_PARAM                0x80    /* start/end parameter list */
        !           175: 
        !           176: #define        LK_CMD_RESUME           0x8b
        !           177: #define        LK_CMD_INHIBIT          0xb9
        !           178: #define        LK_CMD_LEDS_ON          0x13    /* 1 param: led bitmask */
        !           179: #define        LK_CMD_LEDS_OFF         0x11    /* 1 param: led bitmask */
        !           180: #define        LK_CMD_DIS_KEYCLK       0x99
        !           181: #define        LK_CMD_ENB_KEYCLK       0x1b    /* 1 param: volume */
        !           182: #define        LK_CMD_DIS_CTLCLK       0xb9
        !           183: #define        LK_CMD_ENB_CTLCLK       0xbb
        !           184: #define        LK_CMD_SOUND_CLK        0x9f
        !           185: #define        LK_CMD_DIS_BELL         0xa1
        !           186: #define        LK_CMD_ENB_BELL         0x23    /* 1 param: volume */
        !           187: #define        LK_CMD_BELL             0xa7
        !           188: #define        LK_CMD_TMP_NORPT        0xc1
        !           189: #define        LK_CMD_ENB_RPT          0xe3
        !           190: #define        LK_CMD_DIS_RPT          0xe1
        !           191: #define        LK_CMD_RPT_TO_DOWN      0xd9
        !           192: #define        LK_CMD_REQ_ID           0xab
        !           193: #define        LK_CMD_POWER_UP         0xfd
        !           194: #define        LK_CMD_TEST_MODE        0xcb
        !           195: #define        LK_CMD_SET_DEFAULTS     0xd3
        !           196: 
        !           197: /* there are 4 leds, represent them in the low 4 bits of a byte */
        !           198: #define        LK_PARAM_LED_MASK(ledbmap)      (LK_PARAM|(ledbmap))
        !           199: 
        !           200: /* max volume is 0, lowest is 0x7 */
        !           201: #define        LK_PARAM_VOLUME(v)              (LK_PARAM|((v)&0x7))
        !           202: 
        !           203: /* mode set command(s) details */
        !           204: #define        LK_MODE_DOWN            0x0
        !           205: #define        LK_MODE_RPT_DOWN        0x2
        !           206: #define        LK_MODE_DOWN_UP         0x6
        !           207: #define        LK_CMD_MODE(m,div)      (LK_PARAM|(div<<3)|m)
        !           208: 
        !           209: 
        !           210: /*
        !           211:  *     Keyboard set_status codes and arguments
        !           212:  */
        !           213: 
        !           214: /* Send a command packet to the lk201 */
        !           215: typedef struct {
        !           216:        unsigned char   len;                            /* how many params */
        !           217:        unsigned char   command;                        /* cmd to lk201 */
        !           218:        unsigned char   params[2];                      /* extra params */
        !           219: } lk201_cmd_t;
        !           220: #define LK201_SEND_CMD         _IOW('q', 5, lk201_cmd_t)/* keybd. per. cmd */
        !           221: 
        !           222: /* Control rotation of lk201 leds */
        !           223: #define LK201_LED_PATTERN      _IOW('q', 119, int)     /* cylon, ... */
        !           224: #      define LED_COUNT        1                       /* led counter */
        !           225: #      define LED_ROTATE       2                       /* led rotate */
        !           226: #      define LED_CYLON        3                       /* led cylon mode */
        !           227: 
        !           228: #define LK201_LED_INTERVAL     _IOW('q', 120, int)     /* refresh interval */
        !           229: #      define LED_OFF          0                       /* no led movement */
        !           230: 
        !           231: /* Map the caps-lock key to act as the control key (skinny-fingers) */
        !           232: #define        LK201_mapLOCKtoCNTRL    _IOW('q', 121, int)     /* 1 or 0 */
        !           233: 
        !           234: /* Remap a lk201 keycode to a different (ASCII) translation */
        !           235: typedef struct {
        !           236:        unsigned char in_keyval;
        !           237:        unsigned char shifted;
        !           238:        unsigned char out_keyval;
        !           239:        unsigned char meta;
        !           240: } KeyMap;
        !           241: #define        LK201_REMAP_KEY          _IOW('q', 122, KeyMap) /* 1 or 0 */

unix.superglobalmegacorp.com

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