mirror of
https://github.com/godotengine/godot.git
synced 2024-11-25 21:52:51 +00:00
Merge pull request #77900 from bruvzg/key_conv
[Input Map] Generate missing values instead of disabling options.
This commit is contained in:
commit
70a82c0b2f
@ -107,6 +107,33 @@ void InputEventConfigurationDialog::_set_event(const Ref<InputEvent> &p_event, c
|
||||
// Update mode selector based on original key event.
|
||||
Ref<InputEventKey> ko = p_original_event;
|
||||
if (ko.is_valid()) {
|
||||
if (ko->get_keycode() == Key::NONE) {
|
||||
if (ko->get_physical_keycode() != Key::NONE) {
|
||||
ko->set_keycode(ko->get_physical_keycode());
|
||||
}
|
||||
if (ko->get_key_label() != Key::NONE) {
|
||||
ko->set_keycode(fix_keycode((char32_t)ko->get_key_label(), Key::NONE));
|
||||
}
|
||||
}
|
||||
|
||||
if (ko->get_physical_keycode() == Key::NONE) {
|
||||
if (ko->get_keycode() != Key::NONE) {
|
||||
ko->set_physical_keycode(ko->get_keycode());
|
||||
}
|
||||
if (ko->get_key_label() != Key::NONE) {
|
||||
ko->set_physical_keycode(fix_keycode((char32_t)ko->get_key_label(), Key::NONE));
|
||||
}
|
||||
}
|
||||
|
||||
if (ko->get_key_label() == Key::NONE) {
|
||||
if (ko->get_keycode() != Key::NONE) {
|
||||
ko->set_key_label(fix_key_label((char32_t)ko->get_keycode(), Key::NONE));
|
||||
}
|
||||
if (ko->get_physical_keycode() != Key::NONE) {
|
||||
ko->set_key_label(fix_key_label((char32_t)ko->get_physical_keycode(), Key::NONE));
|
||||
}
|
||||
}
|
||||
|
||||
key_mode->set_item_disabled(KEYMODE_KEYCODE, ko->get_keycode() == Key::NONE);
|
||||
key_mode->set_item_disabled(KEYMODE_PHY_KEYCODE, ko->get_physical_keycode() == Key::NONE);
|
||||
key_mode->set_item_disabled(KEYMODE_UNICODE, ko->get_key_label() == Key::NONE);
|
||||
|
Loading…
Reference in New Issue
Block a user