2 * Copyright (c) 1999 Greg Haerr <greg@censoft.com>
4 * Keyboard Driver, PC bios version
8 static int KBD_Open(KBDDEVICE *pkd);
9 static void KBD_Close(void);
10 static void KBD_GetModifierInfo(int *modifiers);
11 static int KBD_Read(MWUCHAR *buf, int *modifiers);
12 static int KBD_Poll(void);
14 /* external routines in asmkbd.s*/
15 extern int kbpoll(void);
16 extern int kbread(void);
17 extern int kbflags(void);
31 KBD_Open(KBDDEVICE *pkd)
46 * Return the possible modifiers for the keyboard.
49 KBD_GetModifierInfo(int *modifiers)
51 *modifiers = 0; /* no modifiers available */
55 * This reads one keystroke from the keyboard, and the current state of
56 * the mode keys (ALT, SHIFT, CTRL). Returns -1 on error, 0 if no data
57 * is ready, and 1 if data was read. This is a non-blocking call.
60 KBD_Read(MWUCHAR *buf, int *modifiers)
62 /* wait until a char is ready*/
66 /* read keyboard shift status*/
67 *modifiers = kbflags();
69 /* read keyboard character*/
72 if(*buf == 0x1b) /* special case ESC*/