Documentation updates.

This commit is contained in:
Anna Rose Wiggins 2025-07-04 12:50:46 -04:00
parent db848db810
commit 2e501db084
2 changed files with 20 additions and 4 deletions

View file

@ -44,9 +44,21 @@ type ProportionalAxisMappingRule struct {
LastEvent time.Time LastEvent time.Time
} }
// RuleTargets represent either a device input to match on, or an output to produce.
// Some RuleTarget types may work via side effects, such as RuleTargetModeSelect.
type RuleTarget interface { type RuleTarget interface {
// NormalizeValue takes the raw input value and possibly modifies it based on the Target settings.
// (e.g., inverting the value if Inverted == true)
NormalizeValue(int32) int32 NormalizeValue(int32) int32
// CreateEvent typically takes the (probably normalized) value and returns an event that can be emitted
// on a virtual device.
//
// For RuleTargetModeSelect, this method modifies the active mode and returns nil.
//
// TODO: should we normalize inside this function to simplify the interface?
CreateEvent(int32, *string) *evdev.InputEvent CreateEvent(int32, *string) *evdev.InputEvent
GetCode() evdev.EvCode GetCode() evdev.EvCode
GetDeviceName() string GetDeviceName() string
GetDevice() *evdev.InputDevice GetDevice() *evdev.InputDevice

View file

@ -20,22 +20,23 @@ Joyful might be the tool for you.
* Create virtual devices with up to 8 axes and 80 buttons. * Create virtual devices with up to 8 axes and 80 buttons.
* Make simple 1:1 mappings of buttons and axes: Button1 -> VirtualButtonA * Make simple 1:1 mappings of buttons and axes: Button1 -> VirtualButtonA
* Make combination mappings: Button1 + Button2 -> VirtualButtonA * Make combination mappings: Button1 + Button2 -> VirtualButtonA
* Multiple modes with per-mode behavior.
### Future Features - try them at an unspecified point in the future! ### Future Features - try them at an unspecified point in the future!
* Multiple modes with per-mode behavior.
* Partial axis mapping: map sections of an axis to different outputs. * Partial axis mapping: map sections of an axis to different outputs.
* Highly configurable deadzones * Highly configurable deadzones
* Macros - have a single input produce a sequence of button presses with configurable pauses. * Macros - have a single input produce a sequence of button presses with configurable pauses.
* Sequence combos - Button1, Button2, Button3 -> VirtualButtonA * Sequence combos - Button1, Button2, Button3 -> VirtualButtonA
* Proportional axis to button mapping; repeatedly trigger a button with an axis, with frequency controlled by the axis value
## Configuration ## Configuration
Configuration is currently done via hand-written YAML files in `~/.config/joyful/`. Joyful will read every Configuration is currently done via hand-written YAML files in `~/.config/joyful/`. Joyful will read every
yaml file in this directory and combine them, so you can split your configuration up however you like. yaml file in this directory and combine them, so you can split your configuration up however you like.
Configuration is divided into two sections: `devices` and `rules`. Each of these is a YAML list. Configuration is divided into three sections: `devices`, `modes`, and `rules`. See the `examples/` directory for concrete examples.
The options for each are described in some detail below. See the `examples/` directory for concrete examples. Select options are explained in detail below.
### Device configuration ### Device configuration
@ -65,7 +66,10 @@ Configuration options for each type vary. See <examples/ruletypes.yml> for an ex
### Modes ### Modes
All rules can have a `modes` field that is a list of strings. The top-level `modes` field is a simple list of strings, defining the different modes available to rules. The initial mode is always
the first one in the list. (TODO)
All rules can have a `modes` field that is a list of strings. If no `modes` field is present, the rule will be active in all modes.
## Technical details ## Technical details