Support keyboard buttons and add presets. (#14)
Reviewed-on: #14 Co-authored-by: Anna Rose Wiggins <annabunches@gmail.com> Co-committed-by: Anna Rose Wiggins <annabunches@gmail.com>
This commit is contained in:
parent
61fe5208e6
commit
838449000c
12 changed files with 492 additions and 133 deletions
|
@ -1,19 +1,7 @@
|
|||
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
|
||||
preset: gamepad
|
||||
- name: right-stick
|
||||
type: physical
|
||||
device_name: VIRPIL Controls 20220407 R-VPC Stick MT-50CM2
|
||||
|
|
|
@ -1,5 +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.
|
||||
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 Outer Wilds running in Steam.
|
||||
|
||||
Not every possible input is mapped here, this is just a somewhat minimal example.
|
|
@ -1,18 +1,13 @@
|
|||
devices:
|
||||
- name: primary
|
||||
type: virtual
|
||||
num_buttons: 74
|
||||
num_axes: 8
|
||||
preset: joystick
|
||||
- name: secondary
|
||||
type: virtual
|
||||
num_buttons: 74
|
||||
num_axes: 3
|
||||
preset: joystick
|
||||
- name: mouse
|
||||
type: virtual
|
||||
num_buttons: 0
|
||||
num_axes: 0
|
||||
rel_axes:
|
||||
- REL_WHEEL
|
||||
preset: mouse
|
||||
- name: right-stick
|
||||
type: physical
|
||||
device_name: VIRPIL Controls 20220407 R-VPC Stick MT-50CM2
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
Configuration is divided into three sections: `devices`, `modes`, and `rules`. Each yaml file can have any number of these sections; joyful will combine the configuration from all files at runtime.
|
||||
|
||||
### Device configuration
|
||||
## Device configuration
|
||||
|
||||
Each entry in `devices` must have a couple of parameters:
|
||||
|
||||
|
@ -15,16 +15,18 @@ Each entry in `devices` must have a couple of parameters:
|
|||
|
||||
`virtual` devices can additionally define these parameters:
|
||||
|
||||
* `preset` - Can be `joystick`, `gamepad`, `mouse`, or `keyboard`, and will configure the virtual device to look like and emit an appropriate set of outputs based on the name. For exactly which axes and buttons are defined for each type, see the `Capabilities` values in [internal/config/variables.go](internal/config/variables.go).
|
||||
* `buttons` or `num_buttons` - Either a list of explicit buttons or a number of buttons to create. (max 74 buttons) Linux-native games may not recognize all buttons created by Joyful.
|
||||
* `axes` or `num_axes` - An explicit list of `ABS_` axes or a number to create.
|
||||
* `relative_axes` or `num_relative_axes` - As above, but for `REL_` axes.
|
||||
|
||||
A couple of additional notes on virtual devices:
|
||||
|
||||
* For all 3 of the above options, an explicit list will override the `num_` parameters if both are present.
|
||||
* Some environments will only register mouse events if the device *only* supports mouse-like events, so it can be useful to isolate your `relative_axes` to their own virtual device and explicitly define the axes.
|
||||
* Users are encouraged to use the `preset` options whenever possible. They have the highest probability of working the way you expect. If you need to output to multiple types of device, the best approach is to create multiple virtual devices.
|
||||
* For all 3 of the above options, there is a priority order. If you specify a `preset`, it will be used ignoring any other settings. An explicit list will override the corresponding `num_` parameter.
|
||||
* Some environments/applications are prescriptive about what combinations make sense; for example, they will only register mouse events if the device *only* supports mouse-like events. The `presets` attempt to take this into account. If you are defining capabilities manually and attempt to mix and match button codes, you may also run into this problem.
|
||||
|
||||
### Rules configuration
|
||||
## Rules configuration
|
||||
|
||||
All `rules` must have a `type` parameter. Valid values for this parameter are:
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue