GitLab repository storage has been migrated to hashed layout. Please contact Infrastructure team if you notice any issues with repositories or hooks.

Commit 52a6b486 authored by Alexander Mikhaylenko's avatar Alexander Mikhaylenko

display-box: Don't pass event directly to on_key_press_event()

Instead, pass keyval and state.

Since DisplayView corrects keyval, this means that Nintendo DS shortcuts
are now layout-independent.

See a378f4b8
parent bea89bd2
Pipeline #104693 passed with stages
in 14 minutes and 15 seconds
......@@ -104,16 +104,14 @@ private class Games.DisplayBox : Gtk.Bin {
display_bin.remove (child);
}
public bool on_key_press_event (Gdk.EventKey event) {
public bool on_key_press_event (uint keyval, uint status) {
if (!get_mapped ())
return false;
if (runner == null)
return false;
var default_modifiers = Gtk.accelerator_get_default_mod_mask ();
return runner.key_press_event (event.keyval, event.state & default_modifiers);
return runner.key_press_event (keyval, status);
}
public bool gamepad_button_press_event (Manette.Event event) {
......
......@@ -94,15 +94,15 @@ private class Games.DisplayView : Object, UiView {
public bool on_key_pressed (Gdk.EventKey event) {
var default_modifiers = Gtk.accelerator_get_default_mod_mask ();
if (box.on_key_press_event (event))
return true;
uint keyval;
var keymap = Gdk.Keymap.get_for_display (window.get_display ());
keymap.translate_keyboard_state (event.hardware_keycode, event.state,
event.group, out keyval, null, null, null);
var ctrl_pressed = (event.state & default_modifiers) == Gdk.ModifierType.CONTROL_MASK;
if (box.on_key_press_event (keyval, event.state & default_modifiers))
return true;
if ((keyval == Gdk.Key.f || keyval == Gdk.Key.F) && ctrl_pressed &&
header_bar.can_fullscreen && !savestates_list_state.is_revealed) {
is_fullscreen = !is_fullscreen;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment