Commit graph

9 commits

Author SHA1 Message Date
Bill Currie
5c72ce10d2 [input] Delay event system init
I think I had though it using a constructor init was ok, but it turns
out that was problematic. That, or I missed it in my recent audit. Fixes
a sys syserror during shutdown.
2023-09-21 02:02:12 +09:00
Bill Currie
1a36d3786d [input] Allow buttons and axes to be deregistered
This is used by the Ruamoko input bindings so progs can clean up.
2023-09-15 14:04:21 +09:00
Bill Currie
fab5ae9d1f [input] Delay button and axis init
It turns out that initializing them via constructors led to their
shutdowns happening too late which resulted in problems with button and
axis cleanup.
2023-09-15 13:51:59 +09:00
Bill Currie
89f8dfce09 [input] Clear button inputs when IN_ClearStates called
This fixes the annoying persistence of inputs when respawning and
changing levels. Axis input clearing is hooked up but does nothing as of
yet. Active device input clearing has always been hooked up, but also
does nothing in the evdev and x11 drivers.
2022-05-19 16:47:47 +09:00
Bill Currie
8db8f91e7d [input] Plug a pile of memory leaks
While most were "harmless" in that they were held pointers at shutdown,
a few bugs were exposed in the imt code.
2022-05-12 19:58:18 +09:00
Bill Currie
1a79915d22 [input] Add axis listeners
The listener is invoked when the axis value changes due to IN_UpdateAxis
or IN_ClampAxis updating the axis. This does mean the listener
invocation make be somewhat delayed. I am a tad uncertain about this
design thus it being a separate commit.
2021-11-25 20:04:08 +09:00
Bill Currie
5557bf0b09 [input] Implement axis binding
Each axis binding has its own recipe (meaning the same input axis can be
interpreted differently for each binding)

Recipes are specified with field=value pairs after the axis name.
Valid fields are minzone, maxzone, deadzone, curve and scale, with
deadzone doubling as a balanced/unbalanced flag.

The default recipe has no zones, is balanced, and curve and scale are 1.
2021-11-11 15:51:47 +09:00
Bill Currie
9172e76107 [input] Move name and description into in_axis_t
Like with in_button_t, it makes creating static axes a little easier.
2021-11-10 15:48:22 +09:00
Bill Currie
36f6dcc65e [input] Add logical axes
Like logical buttons, logical axes are engine-defined destinations to
which input ("physical") axes can be bound.
2021-10-01 15:38:48 +09:00