[gnome-games/wip/abhinavsingh/gamepad-config2: 4/20] gamepad: Add standard-gamepad-inputs



commit 44e9246169039b4d6663cfd2deced79becbd7abd
Author: theawless <theawless gmail com>
Date:   Fri Jun 30 23:18:44 2017 +0530

    gamepad: Add standard-gamepad-inputs
    
    This will be used for providing standard gamepad inputs for building
    gamepad mappings.

 src/Makefile.am                          |    1 +
 src/gamepad/standard-gamepad-inputs.vala |   28 ++++++++++++++++++++++++++++
 2 files changed, 29 insertions(+), 0 deletions(-)
---
diff --git a/src/Makefile.am b/src/Makefile.am
index c8f202d..abcac75 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -86,6 +86,7 @@ gnome_games_SOURCES = \
        gamepad/gamepad-monitor.c \
        gamepad/raw-gamepad.c \
        gamepad/raw-gamepad-monitor.c \
+       gamepad/standard-gamepad-inputs.vala \
        \
        generic/generic-game.vala \
        generic/generic-game-uri-adapter.vala \
diff --git a/src/gamepad/standard-gamepad-inputs.vala b/src/gamepad/standard-gamepad-inputs.vala
new file mode 100644
index 0000000..3b26b1d
--- /dev/null
+++ b/src/gamepad/standard-gamepad-inputs.vala
@@ -0,0 +1,28 @@
+// This file is part of GNOME Games. License: GPL-3.0+.
+
+namespace Games {
+       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_THUMBL },
+               {EventCode.EV_KEY, EventCode.BTN_THUMBR },
+               {EventCode.EV_KEY, EventCode.BTN_TL },
+               {EventCode.EV_KEY, EventCode.BTN_TR },
+               {EventCode.EV_KEY, EventCode.BTN_TL2 },
+               {EventCode.EV_KEY, EventCode.BTN_TR2 },
+               {EventCode.EV_KEY, EventCode.BTN_DPAD_UP },
+               {EventCode.EV_KEY, EventCode.BTN_DPAD_LEFT },
+               {EventCode.EV_KEY, EventCode.BTN_DPAD_DOWN },
+               {EventCode.EV_KEY, EventCode.BTN_DPAD_RIGHT },
+               {EventCode.EV_KEY, EventCode.BTN_SELECT },
+               {EventCode.EV_KEY, EventCode.BTN_MODE },
+               {EventCode.EV_KEY, EventCode.BTN_START },
+
+               {EventCode.EV_ABS, EventCode.ABS_X },
+               {EventCode.EV_ABS, EventCode.ABS_RX },
+               {EventCode.EV_ABS, EventCode.ABS_Y },
+               {EventCode.EV_ABS, EventCode.ABS_RY },
+       };
+}


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