1
0
mirror of https://github.com/TomHarte/CLK.git synced 2026-04-20 10:17:05 +00:00

Further improvement: if in physical mode, but pressing an unrecognised key, attempt to 'type' it.

This commit is contained in:
Thomas Harte
2020-03-02 22:08:54 -05:00
parent dc47a2b7d7
commit 1f41d9c5f5
9 changed files with 53 additions and 25 deletions
+4 -2
View File
@@ -14,9 +14,11 @@ MappedMachine::MappedMachine(const std::set<Inputs::Keyboard::Key> &essential_mo
keyboard_.set_delegate(this);
}
void MappedMachine::keyboard_did_change_key(Inputs::Keyboard *keyboard, Inputs::Keyboard::Key key, bool is_pressed) {
bool MappedMachine::keyboard_did_change_key(Inputs::Keyboard *keyboard, Inputs::Keyboard::Key key, bool is_pressed) {
uint16_t mapped_key = get_keyboard_mapper()->mapped_key_for_key(key);
if(mapped_key != KeyNotMapped) set_key_state(mapped_key, is_pressed);
if(mapped_key == KeyNotMapped) return false;
set_key_state(mapped_key, is_pressed);
return true;
}
void MappedMachine::reset_all_keys(Inputs::Keyboard *keyboard) {