mirror of
https://github.com/bradgrantham/apple2e.git
synced 2025-08-08 01:25:02 +00:00
Modified for interactivity
Added peek_key and clear_strobe so that an interrupt key can be probed by main loop
This commit is contained in:
12
keyboard.cpp
12
keyboard.cpp
@@ -128,6 +128,18 @@ void stop_keyboard()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool peek_key(char *k)
|
||||||
|
{
|
||||||
|
if(strobe)
|
||||||
|
*k = last_key;
|
||||||
|
return strobe;
|
||||||
|
}
|
||||||
|
|
||||||
|
void clear_strobe()
|
||||||
|
{
|
||||||
|
strobe = false;
|
||||||
|
}
|
||||||
|
|
||||||
void poll_keyboard()
|
void poll_keyboard()
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
@@ -16,4 +16,10 @@ unsigned char get_keyboard_data_and_strobe();
|
|||||||
// Clears the strobe and pretends that no keys are down.
|
// Clears the strobe and pretends that no keys are down.
|
||||||
unsigned char get_any_key_down_and_clear_strobe();
|
unsigned char get_any_key_down_and_clear_strobe();
|
||||||
|
|
||||||
|
// Peek at the current key
|
||||||
|
bool peek_key(char *k);
|
||||||
|
|
||||||
|
// Peek at the current key
|
||||||
|
void clear_strobe();
|
||||||
|
|
||||||
#endif /* _KEYBOARD_H_ */
|
#endif /* _KEYBOARD_H_ */
|
||||||
|
Reference in New Issue
Block a user