1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-11-23 03:32:32 +00:00

Adds a second virtual key, for break.

This commit is contained in:
Thomas Harte 2020-02-29 23:11:02 -05:00
parent 77c0cc8b5f
commit 9273e9b6ed
3 changed files with 8 additions and 0 deletions

View File

@ -31,6 +31,7 @@ uint16_t KeyboardMapper::mapped_key_for_key(Inputs::Keyboard::Key key) {
// Virtual keys follow.
BIND(Backspace, KeyDelete);
BIND(Escape, KeyBreak);
}
#undef BIND
return KeyboardMachine::MappedMachine::KeyNotMapped;

View File

@ -26,6 +26,7 @@ enum Key: uint16_t {
// Add some virtual keys; these do not exist on a real ZX80 or ZX81. They're just a convenience.
KeyDelete = 0x0801,
KeyBreak = 0x0802,
};
struct KeyboardMapper: public KeyboardMachine::MappedMachine::KeyboardMapper {

View File

@ -359,6 +359,12 @@ template<bool is_zx81> class ConcreteMachine:
set_key_state(KeyShift, is_pressed);
set_key_state(Key0, is_pressed);
break;
case KeyBreak:
// Map break to shift+space.
set_key_state(KeyShift, is_pressed);
set_key_state(KeySpace, is_pressed);
break;
}
} else {
if(is_pressed)