Add support for combining 2 axes into one virtual axis. (#11)
Reviewed-on: #11
This commit is contained in:
parent
7b520af24a
commit
3196d4ea22
14 changed files with 321 additions and 61 deletions
|
@ -66,27 +66,20 @@ rules:
|
|||
|
||||
|
||||
# Vertical thrust is on the VPC "paddles" in the main flight mode
|
||||
- type: axis
|
||||
name: translation up
|
||||
- type: axis-combined
|
||||
name: translation vertical
|
||||
modes:
|
||||
- main
|
||||
input:
|
||||
device: right-stick
|
||||
axis: ABS_THROTTLE
|
||||
output:
|
||||
device: primary
|
||||
axis: ABS_THROTTLE
|
||||
|
||||
- type: axis
|
||||
name: translation down
|
||||
modes:
|
||||
- main
|
||||
input:
|
||||
input_lower:
|
||||
device: left-stick
|
||||
axis: ABS_THROTTLE
|
||||
axis: Throttle
|
||||
inverted: true
|
||||
input_upper:
|
||||
device: right-stick
|
||||
axis: Throttle
|
||||
output:
|
||||
device: primary
|
||||
axis: ABS_RUDDER
|
||||
axis: RZ
|
||||
|
||||
# By default, the left thumbstick controls tractor beam via mousewheel
|
||||
- type: axis-to-relaxis
|
||||
|
@ -125,30 +118,15 @@ rules:
|
|||
# In Mining mode, we move vertical thrust to the left thumbstick
|
||||
# and remap the right paddle to be mining laser power
|
||||
- type: axis
|
||||
name: translation up alternate
|
||||
name: translation up/down alternate
|
||||
modes:
|
||||
- mining
|
||||
input:
|
||||
device: left-stick
|
||||
axis: RY
|
||||
deadzone_start: 29250
|
||||
deadzone_end: 64000
|
||||
output:
|
||||
device: primary
|
||||
axis: ABS_THROTTLE
|
||||
|
||||
- type: axis
|
||||
name: translation down alternate
|
||||
modes:
|
||||
- mining
|
||||
input:
|
||||
device: left-stick
|
||||
axis: RY
|
||||
deadzone_start: 0
|
||||
deadzone_end: 30500
|
||||
output:
|
||||
device: primary
|
||||
axis: ABS_RUDDER
|
||||
axis: RZ
|
||||
|
||||
- type: axis
|
||||
name: mining laser
|
||||
|
@ -156,7 +134,7 @@ rules:
|
|||
- mining
|
||||
input:
|
||||
device: right-stick
|
||||
axis: ABS_THROTTLE
|
||||
axis: Throttle
|
||||
output:
|
||||
device: primary
|
||||
axis: RZ
|
||||
axis: Throttle
|
||||
|
|
|
@ -6,7 +6,7 @@ devices:
|
|||
- name: secondary
|
||||
type: virtual
|
||||
num_buttons: 74
|
||||
num_axes: 2
|
||||
num_axes: 3
|
||||
- name: mouse
|
||||
type: virtual
|
||||
num_buttons: 0
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
## 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 in two different files; this is by design.
|
||||
Note that we re-define the top-level `rules` element in two different files; this provides a way to organize
|
||||
your rules however you like.
|
||||
|
||||
It also serves as a real-world example demonstrating many of the available features of the system.
|
||||
It is copied from the author's actual mappings for Star Citizen.
|
||||
It is copied from the author's actual mappings for Star Citizen, using dual Virpil Constellation Alpha joysticks,
|
||||
CH Products pedals, and a custom-built button panel. (see https://git.annabunches.net/anna/hardware-projects/src/branch/main/flight-panel-2021-11 for
|
||||
implementation details of the button panel)
|
|
@ -54,6 +54,19 @@ rules:
|
|||
device: main
|
||||
axis: ABS_Y
|
||||
|
||||
# Create a single merged output axis from 2 input axes
|
||||
- type: axis-combined
|
||||
input_lower:
|
||||
device: flightstick
|
||||
axis: X
|
||||
inverted: true # the lower half of the axis will often need to be inverted
|
||||
input_uppper:
|
||||
device: flightstick
|
||||
axis: RX
|
||||
output:
|
||||
device: main
|
||||
axis: RZ
|
||||
|
||||
# Straightforward button mapping
|
||||
- type: button
|
||||
input:
|
||||
|
|
|
@ -32,6 +32,7 @@ All `rules` must have a `type` parameter. Valid values for this parameter are:
|
|||
* `button-combo` - multiple input buttons mapped to a single output. The output event will trigger when all the input conditions are met.
|
||||
* `button-latched` - a single button mapped to a single output, but each time the input is pressed, the output will toggle.
|
||||
* `axis` - a simple axis mapping
|
||||
* `axis-combined` - a mapping that combines 2 input axes into a single output axis.
|
||||
* `axis-to-button` - causes an axis input to produce a button output. This can be repeated with variable speed proportional to the axis' input value
|
||||
* `axis-to-relaxis` - like axis-to-button, but produces a "relative axis" output value. This is useful for simulating mouse scrollwheel and movement events.
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue