root/include/linux/keyboard.h

/* [previous][next][first][last][top][bottom][index][help] */

INCLUDED FROM


DEFINITIONS

This source file includes following definitions.
  1. kbd_flag
  2. set_kbd_flag
  3. clr_kbd_flag
  4. chg_kbd_flag
  5. vc_kbd_flag
  6. set_vc_kbd_flag
  7. clr_vc_kbd_flag
  8. chg_vc_kbd_flag

   1 #ifndef __LINUX_KEYBOARD_H
   2 #define __LINUX_KEYBOARD_H
   3 
   4 /*
   5  * Global flags: things that don't change between virtual consoles.
   6  * This includes things like "key-down" flags - if the shift key is
   7  * down when you change a console, it's down in both.
   8  *
   9  * Note that the KG_CAPSLOCK flags is NOT the flag that decides if
  10  * capslock is on or not: it's just a flag about the key being
  11  * physically down. The actual capslock status is in the local flags.
  12  */
  13 extern unsigned long kbd_flags;
  14 
  15 /*
  16  * These are the hardcoded global flags - use the numbers beyond 16
  17  * for non-standard or keyboard-dependent flags
  18  */
  19 #define KG_LSHIFT       0
  20 #define KG_RSHIFT       1
  21 #define KG_LCTRL        2
  22 #define KG_RCTRL        3
  23 #define KG_ALT          4
  24 #define KG_ALTGR        5
  25 #define KG_CAPSLOCK     6
  26 #define KG_E0           7
  27 #define KG_E1           8
  28 
  29 /*
  30  * kbd->xxx contains the VC-local things (flag settings etc..)
  31  * The low 3 local flags are hardcoded to be the led setting..
  32  */
  33 struct kbd_struct {
  34         unsigned long flags;
  35         unsigned long default_flags;
  36         unsigned char kbd_flags;
  37 };
  38 
  39 extern struct kbd_struct kbd_table[];
  40 
  41 /*
  42  * These are the local "softflags", giving actual keyboard modes. The
  43  * three first flags are coded to the led settings.
  44  */
  45 #define VC_SCROLLOCK    0       /* scroll-lock mode */
  46 #define VC_NUMLOCK      1       /* numeric lock mode */
  47 #define VC_CAPSLOCK     2       /* capslock mode */
  48 #define VC_APPLIC       3       /* application key mode */
  49 #define VC_CKMODE       5       /* cursor key mode */
  50 #define VC_REPEAT       6       /* keyboard repeat */
  51 #define VC_RAW          7       /* raw (scancode) mode */
  52 #define VC_CRLF         8       /* 0 - enter sends CR, 1 - enter sends CRLF */
  53 #define VC_META         9       /* 0 - meta, 1 - meta=prefix with ESC */
  54 
  55 #define LED_MASK        7
  56 
  57 #ifndef KBD_DEFFLAGS
  58 #define KBD_DEFFLAGS ((1 << VC_NUMLOCK) | (1 << VC_REPEAT))
  59 #endif
  60 
  61 extern unsigned long kbd_init(unsigned long);
  62 
  63 extern inline int kbd_flag(int flag)
     /* [previous][next][first][last][top][bottom][index][help] */
  64 {
  65         return kbd_flags & (1 << flag);
  66 }
  67 
  68 extern inline void set_kbd_flag(int flag)
     /* [previous][next][first][last][top][bottom][index][help] */
  69 {
  70         kbd_flags |= 1 << flag;
  71 }
  72 
  73 extern inline void clr_kbd_flag(int flag)
     /* [previous][next][first][last][top][bottom][index][help] */
  74 {
  75         kbd_flags &= ~(1 << flag);
  76 }
  77 
  78 extern inline void chg_kbd_flag(int flag)
     /* [previous][next][first][last][top][bottom][index][help] */
  79 {
  80         kbd_flags ^= 1 << flag;
  81 }
  82 
  83 extern inline int vc_kbd_flag(struct kbd_struct * kbd, int flag)
     /* [previous][next][first][last][top][bottom][index][help] */
  84 {
  85         return ((kbd->flags >> flag) & 1);
  86 }
  87 
  88 extern inline void set_vc_kbd_flag(struct kbd_struct * kbd, int flag)
     /* [previous][next][first][last][top][bottom][index][help] */
  89 {
  90         kbd->flags |= 1 << flag;
  91 }
  92 
  93 extern inline void clr_vc_kbd_flag(struct kbd_struct * kbd, int flag)
     /* [previous][next][first][last][top][bottom][index][help] */
  94 {
  95         kbd->flags &= ~(1 << flag);
  96 }
  97 
  98 extern inline void chg_vc_kbd_flag(struct kbd_struct * kbd, int flag)
     /* [previous][next][first][last][top][bottom][index][help] */
  99 {
 100         kbd->flags ^= 1 << flag;
 101 }
 102 
 103 #endif

/* [previous][next][first][last][top][bottom][index][help] */