2 * Copyright (c) 1999 Greg Haerr <greg@censoft.com>
4 * Copyright (c) 2000 Victor Larionov, Victor Rogachev <rogach@sut.ru>
6 * Keyboard Driver, TURBO C version
12 static int KBD_Open(KBDDEVICE *pkd);
13 static void KBD_Close(void);
14 static void KBD_GetModifierInfo(int *modifiers);
15 static int KBD_Read(MWUCHAR *buf, int *modifiers);
16 static int KBD_Poll(void);
30 KBD_Open(KBDDEVICE *pkd)
44 * Return the possible modifiers for the keyboard.
47 KBD_GetModifierInfo(int *modifiers)
49 *modifiers = bioskey(2); /* no modifiers available */
53 * This reads one keystroke from the keyboard, and the current state of
54 * the mode keys (ALT, SHIFT, CTRL). Returns -1 on error, 0 if no data
55 * is ready, and 1 if data was read. This is a non-blocking call.
58 KBD_Read(MWUCHAR *buf, int *modifiers)
60 /* wait until a char is ready*/
64 /* read keyboard shift status*/
65 *modifiers = bioskey(2);
67 /* read keyboard character*/
70 if(*buf == 0x1b) /* special case ESC*/