2 * Copyright (c) 1999 Greg Haerr <greg@censoft.com>
4 * Copyright (c) 1999 Victor Rogachev <rogach@sut.ru>
6 * Keyboard Driver, DOS & DJGPP & GRX version
14 static int KBD_Open(KBDDEVICE *pkd);
15 static void KBD_Close(void);
16 static void KBD_GetModifierInfo(int *modifiers);
17 static int KBD_Read(MWUCHAR *buf, int *modifiers);
18 static int KBD_Poll(void);
34 KBD_Open(KBDDEVICE *pkd)
49 * Return the possible modifiers for the keyboard.
52 KBD_GetModifierInfo(int *modifiers)
54 *modifiers = bioskey(2);
58 * This reads one keystroke from the keyboard, and the current state of
59 * the mode keys (ALT, SHIFT, CTRL). Returns -1 on error, 0 if no data
60 * is ready, and 1 if data was read. This is a non-blocking call.
63 KBD_Read(MWUCHAR *buf, int *modifiers)
65 /* wait until a char is ready*/
69 /* read keyboard shift status*/
70 *modifiers = bioskey(2);
72 /* read keyboard character*/
75 if(*buf == 0x1b) /* special case ESC*/