The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/sys/kbio.h

Version: -  FREEBSD  -  FREEBSD-13-STABLE  -  FREEBSD-13-0  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  l41  -  OPENBSD  -  linux-2.6  -  MK84  -  PLAN9  -  xnu-8792 
SearchContext: -  none  -  3  -  10 

    1 /*-
    2  * $FreeBSD: releng/7.4/sys/sys/kbio.h 162711 2006-09-27 19:57:02Z ru $
    3  */
    4 
    5 #ifndef _SYS_KBIO_H_
    6 #define _SYS_KBIO_H_
    7 
    8 #ifndef _KERNEL
    9 #include <sys/types.h>
   10 #endif
   11 #include <sys/ioccom.h>
   12 
   13 /* get/set keyboard I/O mode */
   14 #define K_RAW           0               /* keyboard returns scancodes   */
   15 #define K_XLATE         1               /* keyboard returns ascii       */
   16 #define K_CODE          2               /* keyboard returns keycodes    */
   17 #define KDGKBMODE       _IOR('K', 6, int)
   18 #define KDSKBMODE       _IOWINT('K', 7)
   19 
   20 /* make tone */
   21 #define KDMKTONE        _IOWINT('K', 8)
   22 
   23 /* see console.h for the definitions of the following ioctls */
   24 #ifdef notdef
   25 #define KDGETMODE       _IOR('K', 9, int)
   26 #define KDSETMODE       _IOWINT('K', 10)
   27 #define KDSBORDER       _IOWINT('K', 13)
   28 #endif
   29 
   30 /* get/set keyboard lock state */
   31 #define CLKED           1               /* Caps locked                  */
   32 #define NLKED           2               /* Num locked                   */
   33 #define SLKED           4               /* Scroll locked                */
   34 #define ALKED           8               /* AltGr locked                 */
   35 #define LOCK_MASK       (CLKED | NLKED | SLKED | ALKED)
   36 #define KDGKBSTATE      _IOR('K', 19, int)
   37 #define KDSKBSTATE      _IOWINT('K', 20)
   38 
   39 /* enable/disable I/O access */
   40 #define KDENABIO        _IO('K', 60)
   41 #define KDDISABIO       _IO('K', 61)
   42 
   43 /* make sound */
   44 #define KIOCSOUND       _IOWINT('K', 63)
   45 
   46 /* get keyboard model */
   47 #define KB_OTHER        0               /* keyboard not known           */
   48 #define KB_84           1               /* 'old' 84 key AT-keyboard     */
   49 #define KB_101          2               /* MF-101 or MF-102 keyboard    */
   50 #define KDGKBTYPE       _IOR('K', 64, int)
   51 
   52 /* get/set keyboard LED state */
   53 #define LED_CAP         1               /* Caps lock LED                */
   54 #define LED_NUM         2               /* Num lock LED                 */
   55 #define LED_SCR         4               /* Scroll lock LED              */
   56 #define LED_MASK        (LED_CAP | LED_NUM | LED_SCR)
   57 #define KDGETLED        _IOR('K', 65, int)
   58 #define KDSETLED        _IOWINT('K', 66)
   59 
   60 /* set keyboard repeat rate (obsolete, use KDSETREPEAT below) */
   61 #define KDSETRAD        _IOWINT('K', 67)
   62 
   63 struct keyboard_info {
   64         int             kb_index;       /* kbdio index#                 */
   65         char            kb_name[16];    /* driver name                  */
   66         int             kb_unit;        /* unit#                        */
   67         int             kb_type;        /* KB_84, KB_101, KB_OTHER,...  */
   68         int             kb_config;      /* device configuration flags   */
   69         int             kb_flags;       /* internal flags               */
   70 };
   71 typedef struct keyboard_info keyboard_info_t;
   72 
   73 /* add/remove keyboard to/from mux */
   74 #define KBADDKBD        _IOW('K', 68, keyboard_info_t)  /* add keyboard */
   75 #define KBRELKBD        _IOW('K', 69, keyboard_info_t)  /* release keyboard */
   76 
   77 /* see console.h for the definition of the following ioctl */
   78 #ifdef notdef
   79 #define KDRASTER        _IOW('K', 100, scr_size_t)
   80 #endif
   81 
   82 /* get keyboard information */
   83 #define KDGKBINFO       _IOR('K', 101, keyboard_info_t)
   84 
   85 /* set/get keyboard repeat rate (new interface) */
   86 struct keyboard_repeat {
   87         int             kb_repeat[2];
   88 };
   89 typedef struct keyboard_repeat keyboard_repeat_t;
   90 #define KDSETREPEAT     _IOW('K', 102, keyboard_repeat_t)
   91 #define KDGETREPEAT     _IOR('K', 103, keyboard_repeat_t)
   92 
   93 /* get/set key map/accent map/function key strings */
   94 
   95 #define NUM_KEYS        256             /* number of keys in table      */
   96 #define NUM_STATES      8               /* states per key               */
   97 #define ALTGR_OFFSET    128             /* offset for altlock keys      */
   98 
   99 #define NUM_DEADKEYS    15              /* number of accent keys        */
  100 #define NUM_ACCENTCHARS 52              /* max number of accent chars   */
  101 
  102 #define NUM_FKEYS       96              /* max number of function keys  */
  103 #define MAXFK           16              /* max length of a function key str */
  104 
  105 #ifndef _KEYMAP_DECLARED
  106 #define _KEYMAP_DECLARED
  107 
  108 struct keyent_t {
  109         u_char          map[NUM_STATES];
  110         u_char          spcl;
  111         u_char          flgs;
  112 #define FLAG_LOCK_O     0
  113 #define FLAG_LOCK_C     1
  114 #define FLAG_LOCK_N     2
  115 };
  116 
  117 struct keymap {
  118         u_short         n_keys;
  119         struct keyent_t key[NUM_KEYS];
  120 };
  121 typedef struct keymap keymap_t;
  122 
  123 #endif /* !_KEYMAP_DECLARED */
  124 
  125 /* defines for "special" keys (spcl bit set in keymap) */
  126 #define NOP             0x00            /* nothing (dead key)           */
  127 #define LSH             0x02            /* left shift key               */
  128 #define RSH             0x03            /* right shift key              */
  129 #define CLK             0x04            /* caps lock key                */
  130 #define NLK             0x05            /* num lock key                 */
  131 #define SLK             0x06            /* scroll lock key              */
  132 #define LALT            0x07            /* left alt key                 */
  133 #define BTAB            0x08            /* backwards tab                */
  134 #define LCTR            0x09            /* left control key             */
  135 #define NEXT            0x0a            /* switch to next screen        */
  136 #define F_SCR           0x0b            /* switch to first screen       */
  137 #define L_SCR           0x1a            /* switch to last screen        */
  138 #define F_FN            0x1b            /* first function key           */
  139 #define L_FN            0x7a            /* last function key            */
  140 /*                      0x7b-0x7f          reserved do not use !        */
  141 #define RCTR            0x80            /* right control key            */
  142 #define RALT            0x81            /* right alt (altgr) key        */
  143 #define ALK             0x82            /* alt lock key                 */
  144 #define ASH             0x83            /* alt shift key                */
  145 #define META            0x84            /* meta key                     */
  146 #define RBT             0x85            /* boot machine                 */
  147 #define DBG             0x86            /* call debugger                */
  148 #define SUSP            0x87            /* suspend power (APM)          */
  149 #define SPSC            0x88            /* toggle splash/text screen    */
  150 
  151 #define F_ACC           DGRA            /* first accent key             */
  152 #define DGRA            0x89            /* grave                        */
  153 #define DACU            0x8a            /* acute                        */
  154 #define DCIR            0x8b            /* circumflex                   */
  155 #define DTIL            0x8c            /* tilde                        */
  156 #define DMAC            0x8d            /* macron                       */
  157 #define DBRE            0x8e            /* breve                        */
  158 #define DDOT            0x8f            /* dot                          */
  159 #define DUML            0x90            /* umlaut/diaresis              */
  160 #define DDIA            0x90            /* diaresis                     */
  161 #define DSLA            0x91            /* slash                        */
  162 #define DRIN            0x92            /* ring                         */
  163 #define DCED            0x93            /* cedilla                      */
  164 #define DAPO            0x94            /* apostrophe                   */
  165 #define DDAC            0x95            /* double acute                 */
  166 #define DOGO            0x96            /* ogonek                       */
  167 #define DCAR            0x97            /* caron                        */
  168 #define L_ACC           DCAR            /* last accent key              */
  169 
  170 #define STBY            0x98            /* Go into standby mode (apm)   */
  171 #define PREV            0x99            /* switch to previous screen    */
  172 #define PNC             0x9a            /* force system panic */
  173 #define LSHA            0x9b            /* left shift key / alt lock    */
  174 #define RSHA            0x9c            /* right shift key / alt lock   */
  175 #define LCTRA           0x9d            /* left ctrl key / alt lock     */
  176 #define RCTRA           0x9e            /* right ctrl key / alt lock    */
  177 #define LALTA           0x9f            /* left alt key / alt lock      */
  178 #define RALTA           0xa0            /* right alt key / alt lock     */
  179 #define HALT            0xa1            /* halt machine */
  180 #define PDWN            0xa2            /* halt machine and power down */
  181 #define PASTE           0xa3            /* paste from cut-paste buffer */
  182 
  183 #define F(x)            ((x)+F_FN-1)
  184 #define S(x)            ((x)+F_SCR-1)
  185 #define ACC(x)          ((x)+F_ACC)
  186 
  187 struct acc_t {
  188         u_char          accchar;
  189         u_char          map[NUM_ACCENTCHARS][2];
  190 };
  191 
  192 struct accentmap {
  193         u_short         n_accs;
  194         struct acc_t    acc[NUM_DEADKEYS];
  195 };
  196 typedef struct accentmap accentmap_t;
  197 
  198 struct keyarg {
  199         u_short         keynum;
  200         struct keyent_t key;
  201 };
  202 typedef struct keyarg keyarg_t;
  203 
  204 struct fkeytab {
  205         u_char          str[MAXFK];
  206         u_char          len;
  207 };
  208 typedef struct fkeytab fkeytab_t;
  209 
  210 struct fkeyarg {
  211         u_short         keynum;
  212         char            keydef[MAXFK];
  213         char            flen;
  214 };
  215 typedef struct fkeyarg  fkeyarg_t;
  216 
  217 #define GETFKEY         _IOWR('k', 0, fkeyarg_t)
  218 #define SETFKEY         _IOWR('k', 1, fkeyarg_t)
  219 #ifdef notdef           /* see console.h */
  220 #define GIO_SCRNMAP     _IOR('k', 2, scrmap_t)
  221 #define PIO_SCRNMAP     _IOW('k', 3, scrmap_t)
  222 #endif
  223 #define GIO_KEYMAP      _IOR('k', 6, keymap_t)
  224 #define PIO_KEYMAP      _IOW('k', 7, keymap_t)
  225 #define GIO_DEADKEYMAP  _IOR('k', 8, accentmap_t)
  226 #define PIO_DEADKEYMAP  _IOW('k', 9, accentmap_t)
  227 #define GIO_KEYMAPENT   _IOWR('k', 10, keyarg_t)
  228 #define PIO_KEYMAPENT   _IOW('k', 11, keyarg_t)
  229 
  230 /* flags set to the return value in the KD_XLATE mode */
  231 
  232 #define NOKEY           0x100           /* no key pressed marker        */
  233 #define FKEY            0x200           /* function key marker          */
  234 #define MKEY            0x400           /* meta key marker (prepend ESC)*/
  235 #define BKEY            0x800           /* backtab (ESC [ Z)            */
  236 
  237 #define SPCLKEY         0x8000          /* special key                  */
  238 #define RELKEY          0x4000          /* key released                 */
  239 #define ERRKEY          0x2000          /* error                        */
  240 
  241 #define KEYCHAR(c)      ((c) & 0x00ff)
  242 #define KEYFLAGS(c)     ((c) & ~0x00ff)
  243 
  244 #endif /* !_SYS_KBIO_H_ */

Cache object: 88799f87598f4b9a590bcf097209ca9b


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.