From 4ff4757abc5a28dcc57c5b4dbe00b83902bfb562 Mon Sep 17 00:00:00 2001 From: Anna Rose Wiggins Date: Thu, 3 Jul 2025 10:45:29 -0400 Subject: [PATCH] Some example updates. --- examples/{ruletypes.yml => all_types.yml} | 0 examples/multiple_files/axes.yml | 56 ++++++++++++++++++ examples/multiple_files/buttons.yml | 21 +++++++ examples/{ => multiple_files}/devices.yml | 6 ++ examples/multiple_files/readme.md | 7 +++ examples/rules.yml | 70 ----------------------- 6 files changed, 90 insertions(+), 70 deletions(-) rename examples/{ruletypes.yml => all_types.yml} (100%) create mode 100644 examples/multiple_files/axes.yml create mode 100644 examples/multiple_files/buttons.yml rename examples/{ => multiple_files}/devices.yml (62%) create mode 100644 examples/multiple_files/readme.md delete mode 100644 examples/rules.yml diff --git a/examples/ruletypes.yml b/examples/all_types.yml similarity index 100% rename from examples/ruletypes.yml rename to examples/all_types.yml diff --git a/examples/multiple_files/axes.yml b/examples/multiple_files/axes.yml new file mode 100644 index 0000000..59b528f --- /dev/null +++ b/examples/multiple_files/axes.yml @@ -0,0 +1,56 @@ +rules: + - type: simple + input: + device: right-stick + axis: ABS_X + output: + device: main + axis: ABS_X + + - type: simple + input: + device: right-stick + axis: ABS_Y + output: + device: main + axis: ABS_Y + + - type: simple + input: + device: right-stick + axis: ABS_THROTTLE + output: + device: main + axis: ABS_THROTTLE + + - type: simple + input: + device: left-stick + axis: ABS_X + output: + device: main + axis: ABS_RX + + - type: simple + input: + device: left-stick + axis: ABS_Y + output: + device: main + axis: ABS_RY + + - type: simple + input: + device: left-stick + axis: ABS_THROTTLE + output: + device: main + axis: ABS_RUDDER + + - type: simple + input: + device: pedals + axis: ABS_Z + output: + device: main + axis: ABS_Z diff --git a/examples/multiple_files/buttons.yml b/examples/multiple_files/buttons.yml new file mode 100644 index 0000000..73e4a59 --- /dev/null +++ b/examples/multiple_files/buttons.yml @@ -0,0 +1,21 @@ +rules: + - name: Trigger + type: combo + inputs: + - device: right-stick + button: BTN_THUMB + - device: right-stick + button: BTN_THUMB2 + output: + device: main + button: BTN_TRIGGER + - name: Trigger2 + type: combo + inputs: + - device: left-stick + button: BTN_THUMB + - device: left-stick + button: BTN_THUMB2 + output: + device: main + button: BTN_THUMB \ No newline at end of file diff --git a/examples/devices.yml b/examples/multiple_files/devices.yml similarity index 62% rename from examples/devices.yml rename to examples/multiple_files/devices.yml index 16bb4d6..ca20c34 100644 --- a/examples/devices.yml +++ b/examples/multiple_files/devices.yml @@ -9,3 +9,9 @@ devices: - 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 " + - name: button-box + type: physical + device_name: Arduino Arduino Joystick \ No newline at end of file diff --git a/examples/multiple_files/readme.md b/examples/multiple_files/readme.md new file mode 100644 index 0000000..0476295 --- /dev/null +++ b/examples/multiple_files/readme.md @@ -0,0 +1,7 @@ +## multi-file configuration example + +This directory demonstrates how to split your configuration across multiple files. +Note that we re-define the top-level `rules` element; this is by design. + +It also serves as a real-world example demonstrating many of the available features of the system. +It is based on the author's actual mappings for Star Citizen. \ No newline at end of file diff --git a/examples/rules.yml b/examples/rules.yml deleted file mode 100644 index 97c3469..0000000 --- a/examples/rules.yml +++ /dev/null @@ -1,70 +0,0 @@ -rules: - # A simple 1:1 mapping of 2 inputs - - name: basic mapping - type: simple - input: - device: right-stick - button: BTN_BASE6 - output: - device: main - button: BTN_BASE6 - # A couple of axis mappings - - name: x axis - type: simple - input: - device: right-stick - axis: ABS_X - output: - device: main - axis: ABS_X - - name: y axis - type: simple - input: - device: right-stick - axis: ABS_Y - output: - device: main - axis: ABS_Y - # 3-stage trigger for a VPC Constellation Alpha - # This only sends a trigger input when the - # flip trigger is pulled all the way in *and* the inner trigger - # is activated - - name: 3 stage trigger - type: combo - inputs: - - device: right-stick - button: BTN_TRIGGER - inverted: true - - device: right-stick - button: BTN_THUMB - - device: right-stick - button: BTN_THUMB2 - output: - device: main - button: BTN_TRIGGER - # Of course, BTN_TRIGGER above is unnecessary, because on the Constellation Alpha - # it's impossible to press BTN_THUMB without disabling BTN_TRIGGER. So this is a - # simpler form of the same rule for the left stick - - name: 2 stage trigger - type: combo - inputs: - - device: left-stick - button: BTN_THUMB - - device: left-stick - button: BTN_THUMB2 - output: - device: main - button: BTN_THUMB - # You can use the same input in multiple rules. Be careful with this! - # In this example we use the same 2-stage guard, but trigger an additional output - # when the final stage of the VPC's trigger is depressed - - name: alternate 2 stage trigger - type: combo - inputs: - - device: left-stick - button: BTN_THUMB - - device: left-stick - button: BTN_TOP - output: - device: main - button: BTN_THUMB2