vkeybd: allow to disable keyboard input #8377

This commit is contained in:
Robin Gareus 2020-08-26 03:42:05 +02:00
parent ec6237d703
commit fb2d33c6a3
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
3 changed files with 8 additions and 1 deletions

View File

@ -35,6 +35,9 @@ void
PianoKeyBindings::set_layout (Layout layout)
{
switch (layout) {
case NO_KEYS:
clear_notes ();
break;
case QWERTY:
bind_keys_qwerty ();
break;
@ -91,11 +94,13 @@ PianoKeyBindings::layout (std::string const& l)
return S_QWERTY;
} else if (l == "QWERTZ Single") {
return S_QWERTZ;
} else if (l == "None") {
return NO_KEYS;
}
// Unrecognized keyboard layout, maybe an assert is too stringent though
assert(false);
return QWERTY;
return NO_KEYS;
}
const char*

View File

@ -36,6 +36,7 @@ public:
~PianoKeyBindings ();
enum Layout {
NO_KEYS,
QWERTY,
QWERTZ,
AZERTY,

View File

@ -3086,6 +3086,7 @@ RCOptionEditor::RCOptionEditor ()
sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::set_vkeybd_layout)
);
vkeybdlayout->add ("None", _("Mouse-only (no keyboard)"));
vkeybdlayout->add ("QWERTY", _("QWERTY"));
vkeybdlayout->add ("QWERTZ", _("QWERTZ"));
vkeybdlayout->add ("AZERTY", _("AZERTY"));