2 * DOS interrupt 16h handler
16 DEFAULT_DEBUG_CHANNEL(int16
)
18 /**********************************************************************
21 * Handler for int 16h (keyboard)
25 * KEYB.COM (DOS >3.2) adds functions to this interrupt, they are
26 * not currently listed here.
29 void WINAPI
INT_Int16Handler( CONTEXT
*context
)
31 switch AH_reg(context
) {
33 case 0x00: /* Get Keystroke */
34 /* Returns: AH = Scan code
35 AL = ASCII character */
36 TRACE(int16
, "Get Keystroke\n");
37 CONSOLE_GetKeystroke(&AH_reg(context
), &AL_reg(context
));
40 case 0x01: /* Check for Keystroke */
41 /* Returns: ZF set if no keystroke */
43 /* AL = ASCII character */
44 TRACE(int16
, "Check for Keystroke\n");
45 if (!CONSOLE_CheckForKeystroke(&AH_reg(context
), &AL_reg(context
)))
55 case 0x02: /* Get Shift Flags */
58 if (GetAsyncKeyState(VK_RSHIFT
))
59 AL_reg(context
) |= 0x01;
60 if (GetAsyncKeyState(VK_LSHIFT
))
61 AL_reg(context
) |= 0x02;
62 if (GetAsyncKeyState(VK_LCONTROL
) || GetAsyncKeyState(VK_RCONTROL
))
63 AL_reg(context
) |= 0x04;
64 if (GetAsyncKeyState(VK_LMENU
) || GetAsyncKeyState(VK_RMENU
))
65 AL_reg(context
) |= 0x08;
66 if (GetAsyncKeyState(VK_SCROLL
))
67 AL_reg(context
) |= 0x10;
68 if (GetAsyncKeyState(VK_NUMLOCK
))
69 AL_reg(context
) |= 0x20;
70 if (GetAsyncKeyState(VK_CAPITAL
))
71 AL_reg(context
) |= 0x40;
72 if (GetAsyncKeyState(VK_INSERT
))
73 AL_reg(context
) |= 0x80;
74 TRACE(int16
, "Get Shift Flags: returning 0x%02x\n", AL_reg(context
));
77 case 0x03: /* Set Typematic Rate and Delay */
78 FIXME(int16
, "Set Typematic Rate and Delay - Not Supported\n");
81 case 0x09: /* Get Keyboard Functionality */
82 FIXME(int16
, "Get Keyboard Functionality - Not Supported\n");
83 /* As a temporary measure, say that "nothing" is supported... */
87 case 0x0a: /* Get Keyboard ID */
88 FIXME(int16
, "Get Keyboard ID - Not Supported\n");
91 case 0x10: /* Get Enhanced Keystroke */
92 TRACE(int16
, "Get Enhanced Keystroke - Partially supported\n");
93 /* Returns: AH = Scan code
94 AL = ASCII character */
95 CONSOLE_GetKeystroke(&AH_reg(context
), &AL_reg(context
));
99 case 0x11: /* Check for Enhanced Keystroke */
100 /* Returns: ZF set if no keystroke */
102 /* AL = ASCII character */
103 TRACE(int16
, "Check for Enhanced Keystroke - Partially supported\n");
104 if (!CONSOLE_CheckForKeystroke(&AH_reg(context
), &AL_reg(context
)))
110 RESET_ZFLAG(context
);
114 case 0x12: /* Get Extended Shift States */
115 FIXME(int16
, "Get Extended Shift States - Not Supported\n");
119 FIXME(int16
, "Unknown INT 16 function - 0x%x\n", AH_reg(context
));