[gnome-games] ui: Use clearer gamepad button names



commit 938a529d2c972e986a2ef6d1876bbe9416849f07
Author: Alexander Mikhaylenko <alexm gnome org>
Date:   Fri Feb 28 01:10:39 2020 +0500

    ui: Use clearer gamepad button names
    
    Avoid A/B/X/Y and use north/west/south/east. This avoid the Nintendo/XBox
    button label confusion.

 data/gamepads/standard-gamepad.svg       |  8 ++++----
 src/gamepad/event-codes.vapi             |  5 +++++
 src/ui/preferences-subpage-gamepad.vala  | 16 ++++++++--------
 src/ui/preferences-subpage-keyboard.vala | 16 ++++++++--------
 4 files changed, 25 insertions(+), 20 deletions(-)
---
diff --git a/data/gamepads/standard-gamepad.svg b/data/gamepads/standard-gamepad.svg
index ab62e26f..9f27e6f9 100644
--- a/data/gamepads/standard-gamepad.svg
+++ b/data/gamepads/standard-gamepad.svg
@@ -75,13 +75,13 @@
      fit-margin-bottom="0"
      showborder="true" />
   <circle
-     id="a"
+     id="south"
      
style="display:inline;fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.5;enable-background:new"
      cx="164"
      cy="82"
      r="8" />
   <circle
-     id="b"
+     id="east"
      
style="display:inline;fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.5;enable-background:new"
      cx="181"
      cy="65"
@@ -90,14 +90,14 @@
      cy="65"
      cx="147"
      
style="display:inline;fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.49912116;enable-background:new"
-     id="x"
+     id="west"
      r="8" />
   <circle
      r="8"
      cy="48"
      cx="164"
      
style="display:inline;fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.5;enable-background:new"
-     id="y" />
+     id="north" />
   <path
      
style="display:inline;fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.5px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;enable-background:new"
      d="m 123.50003,66.25 c 0,3.250005 -5.75001,3.75 -9.00001,3.75 h -1.5 c -0.7071,0 -1.5,-0.792895 
-1.5,-1.5 v -5 c 0,-0.707105 0.7929,-1.5 1.5,-1.5 h 1.5 c 3.25,0 9.00001,0.5 9.00001,3.75 z"
diff --git a/src/gamepad/event-codes.vapi b/src/gamepad/event-codes.vapi
index 46791a15..e5eb3140 100644
--- a/src/gamepad/event-codes.vapi
+++ b/src/gamepad/event-codes.vapi
@@ -6,6 +6,11 @@ namespace Games.EventCode {
     public const uint16 EV_ABS;
     public const uint16 EV_MAX;
 
+    public const uint16 BTN_SOUTH;
+    public const uint16 BTN_EAST;
+    public const uint16 BTN_WEST;
+    public const uint16 BTN_NORTH;
+
     public const uint16 BTN_A;
     public const uint16 BTN_B;
     public const uint16 BTN_X;
diff --git a/src/ui/preferences-subpage-gamepad.vala b/src/ui/preferences-subpage-gamepad.vala
index 6ea4557d..0da34cf6 100644
--- a/src/ui/preferences-subpage-gamepad.vala
+++ b/src/ui/preferences-subpage-gamepad.vala
@@ -3,10 +3,10 @@
 [GtkTemplate (ui = "/org/gnome/Games/ui/preferences-subpage-gamepad.ui")]
 private class Games.PreferencesSubpageGamepad : Gtk.Box, PreferencesSubpage {
        private const GamepadInput[] STANDARD_GAMEPAD_INPUTS = {
-               { EventCode.EV_KEY, EventCode.BTN_A },
-               { EventCode.EV_KEY, EventCode.BTN_B },
-               { EventCode.EV_KEY, EventCode.BTN_X },
-               { EventCode.EV_KEY, EventCode.BTN_Y },
+               { EventCode.EV_KEY, EventCode.BTN_EAST },
+               { EventCode.EV_KEY, EventCode.BTN_SOUTH },
+               { EventCode.EV_KEY, EventCode.BTN_WEST },
+               { EventCode.EV_KEY, EventCode.BTN_NORTH },
                { EventCode.EV_KEY, EventCode.BTN_START },
                { EventCode.EV_KEY, EventCode.BTN_MODE },
                { EventCode.EV_KEY, EventCode.BTN_SELECT },
@@ -31,8 +31,8 @@ private class Games.PreferencesSubpageGamepad : Gtk.Box, PreferencesSubpage {
                { { EventCode.EV_ABS, EventCode.ABS_Y }, "lefty" },
                { { EventCode.EV_ABS, EventCode.ABS_RX }, "rightx" },
                { { EventCode.EV_ABS, EventCode.ABS_RY }, "righty" },
-               { { EventCode.EV_KEY, EventCode.BTN_A }, "a" },
-               { { EventCode.EV_KEY, EventCode.BTN_B }, "b" },
+               { { EventCode.EV_KEY, EventCode.BTN_EAST }, "east" },
+               { { EventCode.EV_KEY, EventCode.BTN_SOUTH }, "south" },
                { { EventCode.EV_KEY, EventCode.BTN_DPAD_DOWN }, "dpdown" },
                { { EventCode.EV_KEY, EventCode.BTN_DPAD_LEFT }, "dpleft" },
                { { EventCode.EV_KEY, EventCode.BTN_DPAD_RIGHT }, "dpright" },
@@ -46,8 +46,8 @@ private class Games.PreferencesSubpageGamepad : Gtk.Box, PreferencesSubpage {
                { { EventCode.EV_KEY, EventCode.BTN_THUMBR }, "rightstick" },
                { { EventCode.EV_KEY, EventCode.BTN_TL2 }, "lefttrigger" },
                { { EventCode.EV_KEY, EventCode.BTN_TR2 }, "righttrigger" },
-               { { EventCode.EV_KEY, EventCode.BTN_Y }, "x" },
-               { { EventCode.EV_KEY, EventCode.BTN_X }, "y" },
+               { { EventCode.EV_KEY, EventCode.BTN_NORTH }, "north" },
+               { { EventCode.EV_KEY, EventCode.BTN_WEST }, "west" },
        };
 
        private const GamepadViewConfiguration STANDARD_GAMEPAD_VIEW_CONFIGURATION = {
diff --git a/src/ui/preferences-subpage-keyboard.vala b/src/ui/preferences-subpage-keyboard.vala
index c0f79cad..3ef49b45 100644
--- a/src/ui/preferences-subpage-keyboard.vala
+++ b/src/ui/preferences-subpage-keyboard.vala
@@ -3,10 +3,10 @@
 [GtkTemplate (ui = "/org/gnome/Games/ui/preferences-subpage-keyboard.ui")]
 private class Games.PreferencesSubpageKeyboard : Gtk.Box, PreferencesSubpage {
        private const GamepadInput[] KEYBOARD_GAMEPAD_INPUTS = {
-               { EventCode.EV_KEY, EventCode.BTN_A },
-               { EventCode.EV_KEY, EventCode.BTN_B },
-               { EventCode.EV_KEY, EventCode.BTN_X },
-               { EventCode.EV_KEY, EventCode.BTN_Y },
+               { EventCode.EV_KEY, EventCode.BTN_EAST },
+               { EventCode.EV_KEY, EventCode.BTN_SOUTH },
+               { EventCode.EV_KEY, EventCode.BTN_WEST },
+               { EventCode.EV_KEY, EventCode.BTN_NORTH },
                { EventCode.EV_KEY, EventCode.BTN_START },
                { EventCode.EV_KEY, EventCode.BTN_SELECT },
                { EventCode.EV_KEY, EventCode.BTN_THUMBL },
@@ -22,8 +22,8 @@ private class Games.PreferencesSubpageKeyboard : Gtk.Box, PreferencesSubpage {
        };
 
        private const GamepadInputPath[] KEYBOARD_GAMEPAD_INPUT_PATHS = {
-               { { EventCode.EV_KEY, EventCode.BTN_A }, "a" },
-               { { EventCode.EV_KEY, EventCode.BTN_B }, "b" },
+               { { EventCode.EV_KEY, EventCode.BTN_EAST }, "east" },
+               { { EventCode.EV_KEY, EventCode.BTN_SOUTH }, "south" },
                { { EventCode.EV_KEY, EventCode.BTN_DPAD_DOWN }, "dpdown" },
                { { EventCode.EV_KEY, EventCode.BTN_DPAD_LEFT }, "dpleft" },
                { { EventCode.EV_KEY, EventCode.BTN_DPAD_RIGHT }, "dpright" },
@@ -36,8 +36,8 @@ private class Games.PreferencesSubpageKeyboard : Gtk.Box, PreferencesSubpage {
                { { EventCode.EV_KEY, EventCode.BTN_THUMBR }, "rightstick" },
                { { EventCode.EV_KEY, EventCode.BTN_TL2 }, "lefttrigger" },
                { { EventCode.EV_KEY, EventCode.BTN_TR2 }, "righttrigger" },
-               { { EventCode.EV_KEY, EventCode.BTN_Y }, "x" },
-               { { EventCode.EV_KEY, EventCode.BTN_X }, "y" },
+               { { EventCode.EV_KEY, EventCode.BTN_NORTH }, "north" },
+               { { EventCode.EV_KEY, EventCode.BTN_WEST }, "west" },
        };
 
        private const GamepadViewConfiguration KEYBOARD_GAMEPAD_VIEW_CONFIGURATION = {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]