mirror of
https://github.com/TomHarte/CLK.git
synced 2026-04-25 11:17:26 +00:00
Further improvement: if in physical mode, but pressing an unrecognised key, attempt to 'type' it.
This commit is contained in:
@@ -56,10 +56,12 @@ MultiKeyboardMachine::MultiKeyboard::MultiKeyboard(const std::vector<::KeyboardM
|
||||
}
|
||||
}
|
||||
|
||||
void MultiKeyboardMachine::MultiKeyboard::set_key_pressed(Key key, char value, bool is_pressed) {
|
||||
bool MultiKeyboardMachine::MultiKeyboard::set_key_pressed(Key key, char value, bool is_pressed) {
|
||||
bool was_consumed = false;
|
||||
for(const auto &machine: machines_) {
|
||||
machine->get_keyboard().set_key_pressed(key, value, is_pressed);
|
||||
was_consumed |= machine->get_keyboard().set_key_pressed(key, value, is_pressed);
|
||||
}
|
||||
return was_consumed;
|
||||
}
|
||||
|
||||
void MultiKeyboardMachine::MultiKeyboard::reset_all_keys() {
|
||||
|
||||
@@ -32,7 +32,7 @@ class MultiKeyboardMachine: public KeyboardMachine::Machine {
|
||||
public:
|
||||
MultiKeyboard(const std::vector<::KeyboardMachine::Machine *> &machines);
|
||||
|
||||
void set_key_pressed(Key key, char value, bool is_pressed) final;
|
||||
bool set_key_pressed(Key key, char value, bool is_pressed) final;
|
||||
void reset_all_keys() final;
|
||||
const std::set<Key> &observed_keys() final;
|
||||
bool is_exclusive() final;
|
||||
|
||||
Reference in New Issue
Block a user