Fix underscore input not working with jp106 keyboard on wayland platform

This commit is contained in:
Naoto Kondo 2024-11-25 00:23:59 +09:00
parent 893bbdfde8
commit f367a6c231

View file

@ -193,10 +193,7 @@ bool WaylandThread::_seat_state_configure_key_event(SeatState &p_ss, Ref<InputEv
Key keycode = KeyMappingXKB::get_keycode(xkb_state_key_get_one_sym(p_ss.xkb_state, p_keycode));
Key physical_keycode = KeyMappingXKB::get_scancode(p_keycode);
KeyLocation key_location = KeyMappingXKB::get_location(p_keycode);
if (physical_keycode == Key::NONE) {
return false;
}
uint32_t unicode = xkb_state_key_get_utf32(p_ss.xkb_state, p_keycode);
if (keycode == Key::NONE) {
keycode = physical_keycode;
@ -206,6 +203,10 @@ bool WaylandThread::_seat_state_configure_key_event(SeatState &p_ss, Ref<InputEv
keycode -= 'a' - 'A';
}
if (physical_keycode == Key::NONE && keycode == Key::NONE && unicode == 0) {
return false;
}
p_event->set_window_id(DisplayServer::MAIN_WINDOW_ID);
// Set all pressed modifiers.
@ -219,8 +220,6 @@ bool WaylandThread::_seat_state_configure_key_event(SeatState &p_ss, Ref<InputEv
p_event->set_physical_keycode(physical_keycode);
p_event->set_location(key_location);
uint32_t unicode = xkb_state_key_get_utf32(p_ss.xkb_state, p_keycode);
if (unicode != 0) {
p_event->set_key_label(fix_key_label(unicode, keycode));
} else {