1
0
mirror of https://github.com/TomHarte/CLK.git synced 2026-04-25 11:17:26 +00:00

Indicate whether a keypress is a repeat. Treat appropriately in the Apple II.

This commit is contained in:
Thomas Harte
2023-12-28 15:05:55 -05:00
parent 74bee31a78
commit 9344f6a824
11 changed files with 39 additions and 22 deletions
+1 -1
View File
@@ -21,7 +21,7 @@ Keyboard::Keyboard(const std::set<Key> &essential_modifiers) : essential_modifie
Keyboard::Keyboard(const std::set<Key> &observed_keys, const std::set<Key> &essential_modifiers) :
observed_keys_(observed_keys), essential_modifiers_(essential_modifiers), is_exclusive_(false) {}
bool Keyboard::set_key_pressed(Key key, char, bool is_pressed) {
bool Keyboard::set_key_pressed(Key key, char, bool is_pressed, bool) {
const size_t key_offset = size_t(key);
if(key_offset >= key_states_.size()) {
key_states_.resize(key_offset+1, false);
+1 -1
View File
@@ -51,7 +51,7 @@ class Keyboard {
// Host interface.
/// @returns @c true if the key press affects the machine; @c false otherwise.
virtual bool set_key_pressed(Key key, char value, bool is_pressed);
virtual bool set_key_pressed(Key key, char value, bool is_pressed, bool is_repeat);
virtual void reset_all_keys();
/// @returns a set of all Keys that this keyboard responds to.