quakeforge/include
Bill Currie 62f592b92c [input] Create an automatic imt switcher
An imt switcher automatically changes the context's active imt based on
a user specified list of binary inputs. The inputs may be either buttons
(indicated as +button) or cvars (bare name). For buttons, the
pressed/not pressed state is used, and cvars are interpreted as ints
being 0 or not 0. The order of the inputs determines the bit number of
the input, with the first input being bit 0, second bit 1, third bit 2
etc. A default imt is given so large switchers do not need to be fully
configured (the default imt is written to all states).

A context can have any number of switchers attached. The switchers can
wind up fighting over the active imt, but this seems to be something for
the "user" (eg, configuration system) to sort out rather than the
switcher code enforcing anything.

As a result of the inputs being treated as bits, a switcher with N
inputs will have 2**N states, thus there's a maximum of 16 inputs for
now as 65536 states is a lot of configuration.

Using a switcher, setting up a standard strafe/mouse look configuration
is fairly easy.

    imt_create key_game imt_mod
    imt_create key_game imt_mod_strafe imt_mod
    imt_create key_game imt_mod_freelook
    imt_create key_game imt_mod_lookstrafe imt_mod_freelook
    imt_switcher_create mouse key_game imt_mod_strafe +strafe lookstrafe +mlook freelook
    imt_switcher 0 imt_mod 2 imt_mod 4 imt_mod_freelook 8 imt_mod_freelook 12 imt_mod_freelook
    imt_switcher 6 imt_mod_lookstrafe 10 imt_mod_lookstrafe 14 imt_mod_lookstrafe
    in_bind imt_mod mouse axis 0 move.yaw
    in_bind imt_mod mouse axis 1 move.forward
    in_bind imt_mod_strafe mouse axis 0 move.side
    in_bind imt_mod_lookstrafe mouse axis 0 move.side
    in_bind imt_mod_freelook mouse axis 1 move.pitch

This takes advantage of imt chaining and the default imt for the
switcher (there are 8 states that use imt_mod_strafe).

The switcher name must be unique across all contexts, and every imt used
in a switcher must be in the switcher's context.
2021-11-25 20:23:18 +09:00
..
client [client] Reimplement legacy bind and unbind commands 2021-11-25 13:36:02 +09:00
evdev [input] Use a single select call for all drivers 2021-09-26 15:11:07 +09:00
QF [input] Create an automatic imt switcher 2021-11-25 20:23:18 +09:00
qw [util] Make sizebuf and msg sizes unisgned 2021-04-04 15:53:53 +09:00
win32 Get QF cross-compiling using MXE/mingw32 2021-03-27 20:09:37 +09:00
adivtab.h Nuke the rcsid stuff. 2012-04-22 10:56:32 +09:00
alsa_funcs_list.h [audio] Clean up alsa init and add error checking 2021-06-25 09:50:31 +09:00
anorm_dots.h Massive whitespace cleanup. 2012-05-22 08:23:22 +09:00
anorms.h Massive whitespace cleanup. 2012-05-22 08:23:22 +09:00
asm_draw.h [sw] Fix some 32-bit assembly issues 2021-04-02 22:17:32 +09:00
asm_i386.h Nuke the rcsid stuff. 2012-04-22 10:56:32 +09:00
block8.h Nuke the rcsid stuff. 2012-04-22 10:56:32 +09:00
block16.h Nuke the rcsid stuff. 2012-04-22 10:56:32 +09:00
bsearch.h [util] Add fuzzy and reentrant bsearch 2021-06-01 18:53:53 +09:00
buildnum.h Nuke the rcsid stuff. 2012-04-22 10:56:32 +09:00
compat.h [util] Add fuzzy and reentrant bsearch 2021-06-01 18:53:53 +09:00
context_sdl.h Separate render and presentation initialization 2019-07-09 01:00:47 +09:00
context_win.h [vid] Make windows vid init conform to QF's method 2021-03-31 15:50:10 +09:00
context_x11.h [x11] Use barriers to trap the pointer in the window 2021-11-22 14:59:27 +09:00
d_iface.h [video] Get 16 and 32 bit sw32 mostly working in x11 2021-07-11 00:09:41 +09:00
d_ifacea.h Remove pskindesc from affinetridesc_t. 2012-05-19 09:29:05 +09:00
d_local.h [sw] Fix some 32-bit assembly issues 2021-04-02 22:17:32 +09:00
dga_check.h [video] Mark dga funcs as const when dga not available 2021-08-11 12:09:07 +09:00
exp.h Do a pure/const/noreturn/format attribute pass. 2018-10-09 12:42:21 +09:00
fbset.h big protototype cleanup. Now, except for a few cases, all non-static 2002-11-05 19:12:51 +00:00
garbage.h Nuke the rcsid stuff. 2012-04-22 10:56:32 +09:00
getopt.h make gcc more anal about prototypes, string constants and function 2003-01-06 18:28:13 +00:00
gib_buffer.h [build] Autoconfiscate printf format attribute 2021-03-27 19:52:59 +09:00
gib_builtin.h Nuke the rcsid stuff. 2012-04-22 10:56:32 +09:00
gib_classes.h Nuke the rcsid stuff. 2012-04-22 10:56:32 +09:00
gib_execute.h Nuke the rcsid stuff. 2012-04-22 10:56:32 +09:00
gib_function.h Nuke the rcsid stuff. 2012-04-22 10:56:32 +09:00
gib_handle.h Nuke the rcsid stuff. 2012-04-22 10:56:32 +09:00
gib_object.h Nuke the rcsid stuff. 2012-04-22 10:56:32 +09:00
gib_parse.h Do a pure/const/noreturn/format attribute pass. 2018-10-09 12:42:21 +09:00
gib_process.h Nuke the rcsid stuff. 2012-04-22 10:56:32 +09:00
gib_regex.h Do a pure/const/noreturn/format attribute pass. 2018-10-09 12:42:21 +09:00
gib_semantics.h Nuke the rcsid stuff. 2012-04-22 10:56:32 +09:00
gib_thread.h Nuke the rcsid stuff. 2012-04-22 10:56:32 +09:00
gib_tree.h Nuke the rcsid stuff. 2012-04-22 10:56:32 +09:00
gib_vars.h Nuke the rcsid stuff. 2012-04-22 10:56:32 +09:00
gl_warp_sin.h Nuke the rcsid stuff. 2012-04-22 10:56:32 +09:00
in_win.h Fix win32 (mingw) builds. 2012-02-07 20:18:23 +09:00
in_x11.h [x11] Split up in_x11_init into three stages 2021-11-21 21:22:11 +09:00
logos.h Nuke the rcsid stuff. 2012-04-22 10:56:32 +09:00
Makemodule.am [input] Start work on improved input system 2021-08-27 09:10:21 +09:00
mod_internal.h [model] Clean up the globals for alias models 2021-02-01 21:11:45 +09:00
net_dgrm.h Update for doxygen 1.8.16 2020-02-11 15:22:42 +09:00
net_loop.h Update for doxygen 1.8.16 2020-02-11 15:22:42 +09:00
net_udp.h Update for doxygen 1.8.16 2020-02-11 15:22:42 +09:00
net_vcr.h Update for doxygen 1.8.16 2020-02-11 15:22:42 +09:00
net_wins.h Get QF cross-compiling using MXE/mingw32 2021-03-27 20:09:37 +09:00
netchan.h Fix a bunch of issues found by gcc-11 2021-06-13 14:30:59 +09:00
netmain.h [net] Move found host caching into net_main 2021-04-04 18:38:14 +09:00
noisetextures.h Nuke the rcsid stuff. 2012-04-22 10:56:32 +09:00
old_keys.h Nuke the rcsid stuff. 2012-04-22 10:56:32 +09:00
ops.h Do a pure/const/noreturn/format attribute pass. 2018-10-09 12:42:21 +09:00
pstdint.h Prefer int over long for (u)int32_t. 2010-12-23 09:47:05 +09:00
qfalloca.h Handle alloca "correctly". 2013-01-22 21:02:50 +09:00
qfselect.h [util] Wrap fd_set 2021-09-28 10:53:51 +09:00
qstring.h [util] Add strndup and reentrant quicksort 2021-03-27 20:03:39 +09:00
quakeasm.h Massive whitespace cleanup. 2012-05-22 08:23:22 +09:00
quicksort.h [util] Add fuzzy and reentrant bsearch 2021-06-01 18:53:53 +09:00
r_cvar.h Separate render and presentation initialization 2019-07-09 01:00:47 +09:00
r_dynamic.h [renderer] Stub out all the vulkan functions 2021-01-18 12:46:06 +09:00
r_internal.h [renderer] Move driver specific texture chain defs 2021-07-21 16:36:51 +09:00
r_local.h [renderer] Remove currententity from non-sw renderers 2021-07-22 16:15:14 +09:00
r_scrap.h [renderer] Move core of scrap into shared code 2021-01-13 02:47:07 +09:00
r_screen.h [video] Use views instead of conwidth and conheight 2021-07-10 18:04:34 +09:00
r_shared.h [sw] Fix some 32-bit assembly issues 2021-04-02 22:17:32 +09:00
regex.h Massive whitespace cleanup. 2012-05-22 08:23:22 +09:00
rua_internal.h [ruamoko] Add some stdlib function wrappers 2021-06-01 18:53:53 +09:00
sbar.h Nuke the rcsid stuff. 2012-04-22 10:56:32 +09:00
skin_stencil.h Massive whitespace cleanup. 2012-05-22 08:23:22 +09:00
snd_internal.h [audio] Clean up jack and alsa dependencies 2021-06-27 01:57:59 +09:00
sv_console.h The status bar in the quakeworld server curses console finally does something. Currently only cpu usage, but as a proof-of-concept, it more than does its job. 2007-04-09 00:10:10 +00:00
varrays.h Nuke the rcsid stuff. 2012-04-22 10:56:32 +09:00
vgamodes.h Massive whitespace cleanup. 2012-05-22 08:23:22 +09:00
vid_gl.h Get QF cross-compiling using MXE/mingw32 2021-03-27 20:09:37 +09:00
vid_internal.h [video] Get 16 and 32 bit sw32 mostly working in x11 2021-07-11 00:09:41 +09:00
vid_sw.h [video] Get 16 and 32 bit sw32 mostly working in x11 2021-07-11 00:09:41 +09:00
vid_vulkan.h [vulkan] Move projection matrix code to its own file 2021-04-25 15:48:21 +09:00
vregset.h Nuke the rcsid stuff. 2012-04-22 10:56:32 +09:00
winquake.h [vid] Clean up windows video code a bit 2021-03-31 15:10:35 +09:00
world.h Do a pure/const/noreturn/format attribute pass. 2018-10-09 12:42:21 +09:00