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 
  69 #define LED_MASK        7
  70 
  71 extern unsigned long kbd_init(unsigned long);
  72 
  73 extern inline int kbd_flag(int flag)
     /* [previous][next][first][last][top][bottom][index][help] */
  74 {
  75         return kbd_flags & (1 << flag);
  76 }
  77 
  78 extern inline void set_kbd_flag(int flag)
     /* [previous][next][first][last][top][bottom][index][help] */
  79 {
  80         kbd_flags |= 1 << flag;
  81 }
  82 
  83 extern inline void clr_kbd_flag(int flag)
     /* [previous][next][first][last][top][bottom][index][help] */
  84 {
  85         kbd_flags &= ~(1 << flag);
  86 }
  87 
  88 extern inline void chg_kbd_flag(int flag)
     /* [previous][next][first][last][top][bottom][index][help] */
  89 {
  90         kbd_flags ^= 1 << flag;
  91 }
  92 
  93 extern inline int kbd_dead(int flag)
     /* [previous][next][first][last][top][bottom][index][help] */
  94 {
  95         return kbd_prev_dead_keys & (1 << flag);
  96 }
  97 
  98 extern inline void set_kbd_dead(int flag)
     /* [previous][next][first][last][top][bottom][index][help] */
  99 {
 100         kbd_dead_keys |= 1 << flag;
 101 }
 102 
 103 extern inline void clr_kbd_dead(int flag)
     /* [previous][next][first][last][top][bottom][index][help] */
 104 {
 105         kbd_dead_keys &= ~(1 << flag);
 106 }
 107 
 108 extern inline void chg_kbd_dead(int flag)
     /* [previous][next][first][last][top][bottom][index][help] */
 109 {
 110         kbd_dead_keys ^= 1 << flag;
 111 }
 112 
 113 extern inline int vc_kbd_flag(struct kbd_struct * kbd, int flag)
     /* [previous][next][first][last][top][bottom][index][help] */
 114 {
 115         return ((kbd->flags >> flag) & 1);
 116 }
 117 
 118 extern inline void set_vc_kbd_flag(struct kbd_struct * kbd, int flag)
     /* [previous][next][first][last][top][bottom][index][help] */
 119 {
 120         kbd->flags |= 1 << flag;
 121 }
 122 
 123 extern inline void clr_vc_kbd_flag(struct kbd_struct * kbd, int flag)
     /* [previous][next][first][last][top][bottom][index][help] */
 124 {
 125         kbd->flags &= ~(1 << flag);
 126 }
 127 
 128 extern inline void chg_vc_kbd_flag(struct kbd_struct * kbd, int flag)
     /* [previous][next][first][last][top][bottom][index][help] */
 129 {
 130         kbd->flags ^= 1 << flag;
 131 }
 132 
 133 #endif

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