Browse Source

Mapping updates for windows SDL joysticks

Tobias Hieta 8 years ago
parent
commit
9a535e4fc9

+ 69 - 0
resources/inputmaps/dualshock4-xbox-emulate.json

@@ -0,0 +1,69 @@
+// This is a mapping that works better for the DS4 on windows
+// But since there is no good way to know if its a xbox or ps4 controller
+// connected you need to uncomment the idmatcher line below to get it to work
+//
+{
+  "name": "Playstation Dual Shock 4 Windows Mode",
+  //"idmatcher": "Microsoft.*joystick driver",
+  "mapping": {
+    // D-Pad
+    "KEY_HAT_DOWN": "down",
+    "KEY_HAT_UP": "up",
+    "KEY_HAT_RIGHT": "right",
+    "KEY_HAT_LEFT": "left",
+
+    // Square
+    "KEY_BUTTON_0": "cycle_audio",
+
+    // X
+    "KEY_BUTTON_1": "enter",
+
+    // Circle
+    "KEY_BUTTON_2": {
+      "short": "back",
+      "long": "home"
+    },
+
+    // Triangle
+    "KEY_BUTTON_3": "cycle_subtitles",
+
+    // L1
+    "KEY_BUTTON_4": "seek_backward",
+
+    // L2
+    "KEY_BUTTON_5": "seek_forward",
+
+    // option
+    "KEY_BUTTON_8": "host:toggleDebug",
+
+    // start
+    "KEY_BUTTON_9": "host:fullscreen",
+
+    // press left thumbstick
+    "KEY_BUTTON_10": "",
+
+    // press right thumbstick
+    "KEY_BUTTON_11": "",
+
+    // Playstation button
+    "KEY_BUTTON_12": {
+      "short": "home",
+      "long": "exit"
+    },
+
+    // Trackpad press
+    "KEY_BUTTON_13": "search",
+
+    // left thumbstick axis
+    "KEY_AXIS_0_UP": "left",
+    "KEY_AXIS_0_DOWN": "right",
+    "KEY_AXIS_1_UP": "up",
+    "KEY_AXIS_1_DOWN": "down",
+
+    // right thumbstick axis
+    "KEY_AXIS_3_UP": "increase_volume",
+    "KEY_AXIS_3_DOWN": "decrease_volume",
+    "KEY_AXIS_2_UP": "decrease_audio_delay",
+    "KEY_AXIS_2_DOWN": "increase_audio_delay"
+  }
+}

+ 69 - 8
resources/inputmaps/xbox-controller-mac.json

@@ -1,14 +1,75 @@
 {
   "name": "Xbox Controller",
-  "idmatcher": "Xbox.*",
+  "idmatcher": "XBOX360.*|.*360.*Controller",
   "mapping": 
   {
-      "KEY_BUTTON_13": "left",
-      "KEY_BUTTON_14": "right",
-      "KEY_BUTTON_11": "up",
-      "KEY_BUTTON_12": "down",
-      "KEY_BUTTON_0": "enter",
-      "KEY_BUTTON_1": "back",
-      "KEY_BUTTON_3": "info"
+    // A
+    "KEY_BUTTON_0": "enter",
+
+    // B
+    "KEY_BUTTON_1": {
+      "short": "back",
+      "long": "home"
+    },
+
+    // X
+    "KEY_BUTTON_2": "cycle_audio",
+
+    // Y
+    "KEY_BUTTON_3": "cycle_subtitle",
+
+    // LB
+    "KEY_BUTTON_4": "seek_backward",
+
+    // RB
+    "KEY_BUTTON_5": "seek_forward",
+
+    // left thumbstick press
+    "KEY_BUTTON_6": "",
+
+    // right thumbstick press
+    "KEY_BUTTON_7": "",
+
+    // start
+    "KEY_BUTTON_8": "host:fullscreen",
+
+    // back
+    "KEY_BUTTON_9": "host:toggleDebug",
+
+    // Windows button
+    "KEY_BUTTON_10": {
+      "short": "home",
+      "long": "exit"
+    },
+
+    // D-PAD
+    "KEY_BUTTON_11": "up",
+    "KEY_BUTTON_12": "down",
+    "KEY_BUTTON_13": "left",
+    "KEY_BUTTON_14": "right",
+
+    // left thumbstick axis
+    "KEY_AXIS_0_UP": "left",
+    "KEY_AXIS_0_DOWN": "right",
+    "KEY_AXIS_1_UP": "up",
+    "KEY_AXIS_1_DOWN": "down",
+
+    // right thumbstick axis
+    "KEY_AXIS_4_UP": "increase_volume",
+    "KEY_AXIS_4_DOWN": "decrease_volume",
+    "KEY_AXIS_3_UP": "decrease_audio_delay",
+    "KEY_AXIS_3_DOWN": "increase_audio_delay",
+
+    // left trigger
+    "KEY_AXIS_2_UP": "",
+
+    // right trigger
+    "KEY_AXIS_5_UP": "",
+    
+    // D-Pad with JoyHat events
+    "KEY_HAT_DOWN": "down",
+    "KEY_HAT_UP": "up",
+    "KEY_HAT_RIGHT": "right",
+    "KEY_HAT_LEFT": "left"
   }
 }

+ 19 - 11
resources/inputmaps/xbox-controller-windows.json

@@ -1,6 +1,6 @@
 {
   "name": "Xbox Controller",
-  "idmatcher": "XInput.*|XBOX360.*|.*360.*Controller",
+  "idmatcher": "XInput.*|Microsoft.*joystick driver",
   "mapping": 
   {
     // A
@@ -17,6 +17,7 @@
 
     // Y
     "KEY_BUTTON_3": "cycle_subtitle",
+    "KEY_BUTTON_3": "search",
 
     // LB
     "KEY_BUTTON_4": "seek_backward",
@@ -25,16 +26,16 @@
     "KEY_BUTTON_5": "seek_forward",
 
     // left thumbstick press
-    "KEY_BUTTON_6": "",
+    "KEY_BUTTON_6": "host:toggleDebug",
 
     // right thumbstick press
-    "KEY_BUTTON_7": "",
+    "KEY_BUTTON_7": "host:fullscreen",
 
     // start
-    "KEY_BUTTON_8": "host:fullscreen",
+    "KEY_BUTTON_8": "",
 
     // back
-    "KEY_BUTTON_9": "host:toggleDebug",
+    "KEY_BUTTON_9": "",
 
     // Windows button
     "KEY_BUTTON_10": {
@@ -55,15 +56,22 @@
     "KEY_AXIS_1_DOWN": "down",
 
     // right thumbstick axis
-    "KEY_AXIS_4_UP": "increase_volume",
-    "KEY_AXIS_4_DOWN": "decrease_volume",
-    "KEY_AXIS_3_UP": "decrease_audio_delay",
-    "KEY_AXIS_3_DOWN": "increase_audio_delay",
+    "KEY_AXIS_3_UP": "increase_volume",
+    "KEY_AXIS_3_DOWN": "decrease_volume",
+    "KEY_AXIS_5_UP": "decrease_audio_delay",
+    "KEY_AXIS_5_DOWN": "increase_audio_delay",
 
     // left trigger
     "KEY_AXIS_2_UP": "",
 
     // right trigger
-    "KEY_AXIS_5_UP": ""
+    "KEY_AXIS_5_UP": "",
+    
+    // D-Pad with JoyHat events
+    "KEY_HAT_DOWN": "down",
+    "KEY_HAT_UP": "up",
+    "KEY_HAT_RIGHT": "right",
+    "KEY_HAT_LEFT": "left"
+
   }
-}
+}