From c355c94b5f7dc4e2770f5640f1382b936d594e2e Mon Sep 17 00:00:00 2001 From: Anna Rose Wiggins Date: Fri, 18 Jul 2025 20:43:32 -0400 Subject: [PATCH] Add gamepad mapping example. --- docs/examples/gamepad/axes.yml | 46 +++++++++++++++++ docs/examples/gamepad/buttons.yml | 84 +++++++++++++++++++++++++++++++ docs/examples/gamepad/devices.yml | 25 +++++++++ docs/examples/gamepad/readme.md | 5 ++ 4 files changed, 160 insertions(+) create mode 100644 docs/examples/gamepad/axes.yml create mode 100644 docs/examples/gamepad/buttons.yml create mode 100644 docs/examples/gamepad/devices.yml create mode 100644 docs/examples/gamepad/readme.md diff --git a/docs/examples/gamepad/axes.yml b/docs/examples/gamepad/axes.yml new file mode 100644 index 0000000..9bce3a5 --- /dev/null +++ b/docs/examples/gamepad/axes.yml @@ -0,0 +1,46 @@ +rules: + - type: axis + input: + device: left-stick + axis: X + output: + device: primary + axis: X + - type: axis + input: + device: left-stick + axis: Y + output: + device: primary + axis: Y + + - type: axis + input: + device: right-stick + axis: X + output: + device: primary + axis: RX + - type: axis + input: + device: right-stick + axis: Y + inverted: true + output: + device: primary + axis: RY + + - type: axis + input: + device: right-stick + axis: throttle + output: + device: primary + axis: RZ + - type: axis + input: + device: left-stick + axis: throttle + output: + device: primary + axis: Z diff --git a/docs/examples/gamepad/buttons.yml b/docs/examples/gamepad/buttons.yml new file mode 100644 index 0000000..f4cd31b --- /dev/null +++ b/docs/examples/gamepad/buttons.yml @@ -0,0 +1,84 @@ +rules: + - name: R Red + type: button + input: + device: right-stick + button: BTN_BASE6 + output: + device: primary + button: BTN_SOUTH + - name: R Black + type: button + input: + device: right-stick + button: BTN_PINKIE + output: + device: primary + button: BTN_EAST + - name: R Pinkie + type: button + input: + device: right-stick + button: BTN_TRIGGER_HAPPY14 + output: + device: primary + button: BTN_TR + - name: R Thumbstick + type: button + input: + device: right-stick + button: BTN_TOP2 + output: + device: primary + button: BTN_THUMBR + - name: R Thumb Hat + type: button + input: + device: right-stick + button: BTN_TRIGGER_HAPPY9 + output: + device: primary + button: BTN_START + + - name: L Red + type: button + input: + device: left-stick + button: BTN_BASE6 + output: + device: primary + button: BTN_NORTH + - name: L Black + type: button + input: + device: left-stick + button: BTN_PINKIE + output: + device: primary + button: BTN_WEST + - name: L Pinkie + type: button + input: + device: left-stick + button: BTN_TRIGGER_HAPPY14 + output: + device: primary + button: BTN_TL + - name: L Thumbstick + type: button + input: + device: left-stick + button: BTN_TOP2 + output: + device: primary + button: BTN_THUMBL + - name: L Thumb Hat + type: button + input: + device: left-stick + button: BTN_TRIGGER_HAPPY9 + output: + device: primary + button: BTN_SELECT + + # TODO: d-pad needs hat support diff --git a/docs/examples/gamepad/devices.yml b/docs/examples/gamepad/devices.yml new file mode 100644 index 0000000..4064f25 --- /dev/null +++ b/docs/examples/gamepad/devices.yml @@ -0,0 +1,25 @@ +devices: + - name: primary + type: virtual + num_axes: 6 + buttons: + - BTN_EAST + - BTN_SOUTH + - BTN_NORTH + - BTN_WEST + - BTN_TL + - BTN_TR + - BTN_SELECT + - BTN_START + - BTN_MODE + - BTN_THUMBL + - BTN_THUMBR + - name: right-stick + type: physical + device_name: VIRPIL Controls 20220407 R-VPC Stick MT-50CM2 + - name: left-stick + type: physical + device_name: VIRPIL Controls 20220407 L-VPC Stick MT-50CM2 + - name: pedals + type: physical + device_name: "CH PRODUCTS CH PRO PEDALS USB " diff --git a/docs/examples/gamepad/readme.md b/docs/examples/gamepad/readme.md new file mode 100644 index 0000000..81941b1 --- /dev/null +++ b/docs/examples/gamepad/readme.md @@ -0,0 +1,5 @@ +## joystick -> gamepad mapping + +This is an incomplete example for mapping dual flightsticks (Virpil Constellation Alphas) to gamepad outputs, to support dual-joystick play in games that expect a console-style gamepad. This has been tested on Steam, and it successfully recognizes this as a gamepad. + +Not every possible input is mapped here, this is just a somewhat minimal example. \ No newline at end of file