1
0
mirror of https://github.com/TomHarte/CLK.git synced 2026-04-26 03:29:40 +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
+3 -3
View File
@@ -75,12 +75,12 @@ class KeyboardMachine: public KeyActions {
(i) if @c symbol can be typed and this is a key down, @c type_string it;
(ii) if @c symbol cannot be typed, set @c key as @c is_pressed
*/
bool apply_key(Inputs::Keyboard::Key key, char symbol, bool is_pressed, bool map_logically) {
bool apply_key(Inputs::Keyboard::Key key, char symbol, bool is_pressed, bool is_repeat, bool map_logically) {
Inputs::Keyboard &keyboard = get_keyboard();
if(!map_logically) {
// Try a regular keypress first, and stop if that works.
if(keyboard.set_key_pressed(key, symbol, is_pressed)) {
if(keyboard.set_key_pressed(key, symbol, is_pressed, is_repeat)) {
return true;
}
@@ -103,7 +103,7 @@ class KeyboardMachine: public KeyActions {
// That didn't work. Forward as a keypress. As, either:
// (i) this is a key down, but doesn't have a symbol, or is an untypeable symbol; or
// (ii) this is a key up, which it won't be an issue to miscommunicate.
return keyboard.set_key_pressed(key, symbol, is_pressed);
return keyboard.set_key_pressed(key, symbol, is_pressed, is_repeat);
}
}
};