[gnome-games] gamepad: Add DPad



commit c7ddfddc0f35e23462f038340c274d9604869a6d
Author: Megh Parikh <meghprkh gmail com>
Date:   Mon Jul 18 22:34:50 2016 +0530

    gamepad: Add DPad
    
    This class is responsible for storing the state of a DPad and is used to
    get MappedEvents from unmapped for DPad by Mapping
    
    This is part of a series of commits to add gamepad support.

 src/Makefile.am               |    1 +
 src/gamepad/gamepad-dpad.vala |   12 ++++++++++++
 2 files changed, 13 insertions(+), 0 deletions(-)
---
diff --git a/src/Makefile.am b/src/Makefile.am
index c75991c..1b5812f 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -54,6 +54,7 @@ gnome_games_SOURCES = \
        dummy/dummy-runner.vala \
        \
        gamepad/gamepad-callbacks.vala \
+       gamepad/gamepad-dpad.vala \
        gamepad/gamepad-input-type.vala \
        gamepad/gamepad-mapped-event.vala \
        gamepad/gamepad-mapping-error.vala \
diff --git a/src/gamepad/gamepad-dpad.vala b/src/gamepad/gamepad-dpad.vala
new file mode 100644
index 0000000..2f9154f
--- /dev/null
+++ b/src/gamepad/gamepad-dpad.vala
@@ -0,0 +1,12 @@
+// This file is part of GNOME Games. License: GPLv3
+
+private class Games.GamepadDPad : Object {
+       public GamepadInputType types[4];
+       public int values[4];
+       public int axis_values[2];
+
+       public GamepadDPad () {
+               axis_values[0] = axis_values[1] = 0;
+               types[0] = types[1] = types[2] = types[3] = GamepadInputType.INVALID;
+       }
+}


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