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. kbd_dead
  6. set_kbd_dead
  7. clr_kbd_dead
  8. chg_kbd_dead
  9. vc_kbd_flag
  10. set_vc_kbd_flag
  11. clr_vc_kbd_flag
  12. chg_vc_kbd_flag

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

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