2 * DOS interrupt 16h handler
16 /**********************************************************************
19 * Handler for int 16h (keyboard)
23 * KEYB.COM (DOS >3.2) adds functions to this interrupt, they are
24 * not currently listed here.
27 void WINAPI
INT_Int16Handler( CONTEXT
*context
)
29 switch AH_reg(context
) {
31 case 0x00: /* Get Keystroke */
32 /* Returns: AH = Scan code
33 AL = ASCII character */
34 TRACE(int16
, "Get Keystroke\n");
35 CONSOLE_GetKeystroke(&AH_reg(context
), &AL_reg(context
));
38 case 0x01: /* Check for Keystroke */
39 /* Returns: ZF set if no keystroke */
41 /* AL = ASCII character */
42 TRACE(int16
, "Check for Keystroke\n");
43 if (!CONSOLE_CheckForKeystroke(&AH_reg(context
), &AL_reg(context
)))
53 case 0x02: /* Get Shift Flags */
56 if (GetAsyncKeyState(VK_RSHIFT
))
57 AL_reg(context
) |= 0x01;
58 if (GetAsyncKeyState(VK_LSHIFT
))
59 AL_reg(context
) |= 0x02;
60 if (GetAsyncKeyState(VK_LCONTROL
) || GetAsyncKeyState(VK_RCONTROL
))
61 AL_reg(context
) |= 0x04;
62 if (GetAsyncKeyState(VK_LMENU
) || GetAsyncKeyState(VK_RMENU
))
63 AL_reg(context
) |= 0x08;
64 if (GetAsyncKeyState(VK_SCROLL
))
65 AL_reg(context
) |= 0x10;
66 if (GetAsyncKeyState(VK_NUMLOCK
))
67 AL_reg(context
) |= 0x20;
68 if (GetAsyncKeyState(VK_CAPITAL
))
69 AL_reg(context
) |= 0x40;
70 if (GetAsyncKeyState(VK_INSERT
))
71 AL_reg(context
) |= 0x80;
72 TRACE(int16
, "Get Shift Flags: returning 0x%02x\n", AL_reg(context
));
75 case 0x03: /* Set Typematic Rate and Delay */
76 FIXME(int16
, "Set Typematic Rate and Delay - Not Supported\n");
79 case 0x09: /* Get Keyboard Functionality */
80 FIXME(int16
, "Get Keyboard Functionality - Not Supported\n");
81 /* As a temporary measure, say that "nothing" is supported... */
85 case 0x0a: /* Get Keyboard ID */
86 FIXME(int16
, "Get Keyboard ID - Not Supported\n");
89 case 0x10: /* Get Enhanced Keystroke */
90 TRACE(int16
, "Get Enhanced Keystroke - Partially supported\n");
91 /* Returns: AH = Scan code
92 AL = ASCII character */
93 CONSOLE_GetKeystroke(&AH_reg(context
), &AL_reg(context
));
97 case 0x11: /* Check for Enhanced Keystroke */
98 /* Returns: ZF set if no keystroke */
100 /* AL = ASCII character */
101 TRACE(int16
, "Check for Enhanced Keystroke - Partially supported\n");
102 if (!CONSOLE_CheckForKeystroke(&AH_reg(context
), &AL_reg(context
)))
108 RESET_ZFLAG(context
);
112 case 0x12: /* Get Extended Shift States */
113 FIXME(int16
, "Get Extended Shift States - Not Supported\n");
117 FIXME(int16
, "Unknown INT 16 function - 0x%x\n", AH_reg(context
));