keyboard.h (849B)
1 #ifndef _KEYBOARD_H_ 2 #define _KEYBOARD_H_ 1 3 #if defined(__cplusplus) 4 extern "C" { 5 #endif 6 typedef struct Keyboardctl Keyboardctl; 7 8 struct Keyboardctl 9 { 10 struct Channel *c; /* chan(Rune)[20] */ 11 }; 12 13 14 extern Keyboardctl* initkeyboard(char*); 15 extern int ctlkeyboard(Keyboardctl*, char*); 16 extern void closekeyboard(Keyboardctl*); 17 18 enum { 19 KF= 0xF000, /* Rune: beginning of private Unicode space */ 20 /* KF|1, KF|2, ..., KF|0xC is F1, F2, ..., F12 */ 21 Khome= KF|0x0D, 22 Kup= KF|0x0E, 23 Kpgup= KF|0x0F, 24 Kprint= KF|0x10, 25 Kleft= KF|0x11, 26 Kright= KF|0x12, 27 Kdown= 0x80, 28 Kview= 0x80, 29 Kpgdown= KF|0x13, 30 Kins= KF|0x14, 31 Kend= KF|0x18, 32 33 Kalt= KF|0x15, 34 Kshift= KF|0x16, 35 Kctl= KF|0x17, 36 37 Kbs= 0x08, 38 Kdel= 0x7f, 39 Kesc= 0x1b, 40 Keof= 0x04, 41 42 Kcmd= 0xF100 /* Rune: beginning of Cmd+'a', Cmd+'A', etc on Mac */ 43 }; 44 45 #if defined(__cplusplus) 46 } 47 #endif 48 #endif