Commit 79b52b9e authored by Alexander Mikhaylenko's avatar Alexander Mikhaylenko

ui: Use Gdk.ModifierType for key state instead of uint

This is more correct in general, and we also match GTK4.
parent f2d0f15b
Pipeline #106085 passed with stages
in 16 minutes and 18 seconds
......@@ -76,7 +76,7 @@ private class Games.NintendoDsRunner : RetroRunner {
return new NintendoDsLayoutSwitcher (this);
}
public override bool key_press_event (uint keyval, uint state) {
public override bool key_press_event (uint keyval, Gdk.ModifierType state) {
if (state == Gdk.ModifierType.MOD1_MASK) {
// Alt + 1|2|3|4
var shortcut_layout = layouts[keyval];
......
......@@ -110,7 +110,7 @@ public class Games.CommandRunner : Object, Runner {
return { };
}
public bool key_press_event (uint keyval, uint state) {
public bool key_press_event (uint keyval, Gdk.ModifierType state) {
return false;
}
......
......@@ -28,6 +28,6 @@ public interface Games.Runner : Object {
public abstract Savestate[] get_savestates ();
public abstract InputMode[] get_available_input_modes ();
public abstract bool key_press_event (uint keyval, uint state);
public abstract bool key_press_event (uint keyval, Gdk.ModifierType state);
public abstract bool gamepad_button_press_event (uint16 button);
}
......@@ -76,7 +76,7 @@ private class Games.DummyRunner : Object, Runner {
return { };
}
public bool key_press_event (uint keyval, uint state) {
public bool key_press_event (uint keyval, Gdk.ModifierType state) {
return false;
}
......
......@@ -387,7 +387,7 @@ public class Games.RetroRunner : Object, Runner {
return { InputMode.GAMEPAD };
}
public virtual bool key_press_event (uint keyval, uint state) {
public virtual bool key_press_event (uint keyval, Gdk.ModifierType state) {
return false;
}
......
......@@ -111,7 +111,7 @@ private class Games.DisplayBox : Gtk.Bin {
display_bin.remove (child);
}
public bool on_key_press_event (uint keyval, uint state) {
public bool on_key_press_event (uint keyval, Gdk.ModifierType state) {
if (!get_mapped ())
return false;
......
......@@ -303,7 +303,7 @@ private class Games.SavestatesList : Gtk.Box {
rename_btn.sensitive = (state.selected_savestate != null && !state.selected_savestate.is_automatic ());
}
public bool on_key_press_event (uint keyval, uint state) {
public bool on_key_press_event (uint keyval, Gdk.ModifierType state) {
// FIXME: Move the other list shortcuts here
if (keyval == Gdk.Key.Delete || keyval == Gdk.Key.KP_Delete) {
......
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