You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-08 12:40:44 +00:00
Fix underscore input not working with jp106 keyboard on wayland platform
This commit is contained in:
@@ -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 keycode = KeyMappingXKB::get_keycode(xkb_state_key_get_one_sym(p_ss.xkb_state, p_keycode));
|
||||||
Key physical_keycode = KeyMappingXKB::get_scancode(p_keycode);
|
Key physical_keycode = KeyMappingXKB::get_scancode(p_keycode);
|
||||||
KeyLocation key_location = KeyMappingXKB::get_location(p_keycode);
|
KeyLocation key_location = KeyMappingXKB::get_location(p_keycode);
|
||||||
|
uint32_t unicode = xkb_state_key_get_utf32(p_ss.xkb_state, p_keycode);
|
||||||
if (physical_keycode == Key::NONE) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (keycode == Key::NONE) {
|
if (keycode == Key::NONE) {
|
||||||
keycode = physical_keycode;
|
keycode = physical_keycode;
|
||||||
@@ -206,6 +203,10 @@ bool WaylandThread::_seat_state_configure_key_event(SeatState &p_ss, Ref<InputEv
|
|||||||
keycode -= 'a' - 'A';
|
keycode -= 'a' - 'A';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (physical_keycode == Key::NONE && keycode == Key::NONE && unicode == 0) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
p_event->set_window_id(DisplayServer::MAIN_WINDOW_ID);
|
p_event->set_window_id(DisplayServer::MAIN_WINDOW_ID);
|
||||||
|
|
||||||
// Set all pressed modifiers.
|
// 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_physical_keycode(physical_keycode);
|
||||||
p_event->set_location(key_location);
|
p_event->set_location(key_location);
|
||||||
|
|
||||||
uint32_t unicode = xkb_state_key_get_utf32(p_ss.xkb_state, p_keycode);
|
|
||||||
|
|
||||||
if (unicode != 0) {
|
if (unicode != 0) {
|
||||||
p_event->set_key_label(fix_key_label(unicode, keycode));
|
p_event->set_key_label(fix_key_label(unicode, keycode));
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user