AH = 13h: Wait for Keyboard Event
This function detects keyboard events, even those that don't place keycodes in the keybuffer. This service can read both standard scancodes and the palmtop's extended scancodes. Note that this service translates certain keycodes (see "I16Clip" on page 3-113). It returns to the caller when any of the following 3 conditions are satisfied:
- A keycode is present in the keybuffer. In this case, the key is removed from the buffer, and returned in AX with ZF = 0.
- A mismatch in comparing the keyboard shift flags with BX. If BX is pre-loaded with [SHFLGS2, SHFLGS] before the call, this routine will return with AX = [SHFLGS2, SHFLGS] and ZF = 1 when a a change is detected.
- Timeout occurs (Fixed at 8 Timer0 Ticks or about 0.444 seconds). The routine returns with AX = [SHFLGS2, SHFLGS] and ZF = 1.
- Input: AH = 13h
BX = Current kbd shift flags (same format as service 12h)
- Output: Zero flag is clear if character is available:
AH = Scancode
AL = ASCII character code, or
00h for a special scancode, or
Zero flag is set if timeout or keyboard flags changed.
AX is loaded with the keyboard flags as described in service 12h.
- Error conditions: None
- Registers Modified: AX, FLAGS