#include <oskit/x86/pc/direct_console.h>int direct_cons_trygetchar(void);
Quick poll for an available input character. Returns a character or -1 if no character was available.Due to the large delay between when a character is typed and when the scan code arrives at the keyboard controller (4-5 ms), there are a variety of situations in which this routine may return -1 even though a character has been typed:
In other words, this routine never delays in an attempt to wait for the next scan code to arrive when one is not currently available. Hence the utility of this routine is questionable.
- a valid scan code is in transit from the keyboard when called
- a key release scan code is received (from a previous key press)
- a SHIFT key press is received (shift state is updated however)
- a key press for a multi-character sequence is received (e.g., CTRL or a function key)
Returns a character if available, -1 otherwise.
- base_critical_enter
- 10.2.5
- base_critical_leave
- 10.2.5
- inb
- 10.3.7