quakeforge/include/QF
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
..
classes Massive whitespace cleanup. 2012-05-22 08:23:22 +09:00
GL [renderer] Remove currententity from non-sw renderers 2021-07-22 16:15:14 +09:00
GLSL [renderer] Remove currententity from non-sw renderers 2021-07-22 16:15:14 +09:00
input [input] Create an automatic imt switcher 2021-11-25 20:23:18 +09:00
math Fix a bunch of issues found by gcc-11 2021-06-13 14:30:59 +09:00
plugin [console] Hook up new input system 2021-11-08 11:20:04 +09:00
scene [scene] Rename libQFentity to libQFscene 2021-07-24 14:20:59 +09:00
simd [simd] fix build when avx2 is not available, but avx is. 2021-06-23 01:10:42 +01:00
ui [ui] Add two view manipulation functions 2021-07-10 17:57:59 +09:00
Vulkan [model] Remove 64k limit on visible leafs 2021-07-26 11:32:05 +09:00
alloc.h Update for doxygen 1.8.16 2020-02-11 15:22:42 +09:00
bspfile.h [util] Make bsp_t counts size_t 2021-08-01 21:54:05 +09:00
cbuf.h Update for doxygen 1.8.16 2020-02-11 15:22:42 +09:00
cdaudio.h Merge branch 'master' into vulkan 2020-03-20 13:04:41 +09:00
cexpr.h [build] Autoconfiscate printf format attribute 2021-03-27 19:52:59 +09:00
checksum.h Make header protection consistent 2020-02-24 12:21:20 +09:00
clip_hull.h Nuke the rcsid stuff. 2012-04-22 10:56:32 +09:00
cmd.h [nq,qw] Stop wring to config.cfg 2021-04-12 22:09:09 +09:00
cmem.h [util] Use mmap/munmap for cmem internal alloc/free 2021-07-12 16:33:47 +09:00
console.h [console] Hook up new input system 2021-11-08 11:20:04 +09:00
crc.h Make header protection consistent 2020-02-24 12:21:20 +09:00
csqc.h Nuke the rcsid stuff. 2012-04-22 10:56:32 +09:00
cvar.h [util] Add listeners to cvars 2021-11-25 17:46:16 +09:00
darray.h [util] Hide some initializers from the darray docs 2021-11-25 13:36:02 +09:00
draw.h Make header protection consistent 2020-02-24 12:21:20 +09:00
dstring.h [build] Autoconfiscate printf format attribute 2021-03-27 19:52:59 +09:00
fbsearch.h [util] Add functions for binary heaps 2021-08-02 12:44:08 +09:00
gib.h [build] Autoconfiscate printf format attribute 2021-03-27 19:52:59 +09:00
hash.h [util] FIx an "only" in a comment 2021-01-05 17:40:07 +09:00
heapsort.h [util] Add functions for binary heaps 2021-08-02 12:44:08 +09:00
idparse.h Update for doxygen 1.8.16 2020-02-11 15:22:42 +09:00
image.h [image] Add function to get image memory size 2021-04-25 08:38:13 +09:00
info.h Make header protection consistent 2020-02-24 12:21:20 +09:00
input.h [input] Allow drivers to initialize cvars early 2021-11-21 11:33:58 +09:00
iqm.h Make header protection consistent 2020-02-24 12:21:20 +09:00
joystick.h Make header protection consistent 2020-02-24 12:21:20 +09:00
keys.h [console] Hook up new input system 2021-11-08 11:20:04 +09:00
link.h Make header protection consistent 2020-02-24 12:21:20 +09:00
listener.h [util] Add a listener object 2021-11-25 13:36:02 +09:00
llist.h Make header protection consistent 2020-02-24 12:21:20 +09:00
Makemodule.am [input] Make a start on the new binding system 2021-11-03 19:02:39 +09:00
mathlib.h [vulkan] Clean up and document some of the bsp code 2021-07-13 22:59:51 +09:00
mdfour.h Clean up after removal of uint32.h 2020-02-29 16:11:07 +09:00
mersenne.h Implement the Mersenne Twister PRNG. 2013-01-21 20:05:16 +09:00
model.h [util] Make bsp_t counts size_t 2021-08-01 21:54:05 +09:00
modelgen.h Make header protection consistent 2020-02-24 12:21:20 +09:00
msg.h [util] Add message short and long poke functions 2021-04-04 15:56:14 +09:00
object.h Make header protection consistent 2020-02-24 12:21:20 +09:00
pak.h Make header protection consistent 2020-02-24 12:21:20 +09:00
pakfile.h Update for doxygen 1.8.16 2020-02-11 15:22:42 +09:00
pcx.h Merge branch 'master' into win-merge 2021-03-25 22:42:16 +09:00
plist.h [build] Autoconfiscate printf format attribute 2021-03-27 19:52:59 +09:00
plugin.h [plugin] Clean up the rest of the plugin structs 2021-06-22 19:47:20 +09:00
png.h [image] Add parameter to load only the header 2021-01-19 10:15:57 +09:00
pqueue.h [util] Add an priority queue implementation 2021-08-02 13:29:55 +09:00
pr_comp.h [build] Fix a pile of gcc 10 issues 2020-12-28 18:58:51 +09:00
pr_debug.h [qfcc] Write debug data space to sym file 2020-04-03 21:25:47 +09:00
pr_obj.h [ruamoko] Install and use dispatch tables 2020-03-09 18:11:36 +09:00
pr_type.h [qfcc] Make type encoding union anonymous 2020-03-30 11:10:05 +09:00
progs.h [gamecode] Check resmap return before memset 2021-11-19 11:55:32 +09:00
pvsfile.h [qfvis] Write out the fat-pvs file 2021-07-27 20:04:19 +09:00
qargs.h [util] Expose the quakerc check function 2021-11-14 10:12:14 +09:00
qdefs.h Make header protection consistent 2020-02-24 12:21:20 +09:00
qendian.h Make header protection consistent 2020-02-24 12:21:20 +09:00
qtypes.h [renderer] Move driver specific texture chain defs 2021-07-21 16:36:51 +09:00
quakefs.h Make header protection consistent 2020-02-24 12:21:20 +09:00
quakeio.h [build] Autoconfiscate printf format attribute 2021-03-27 19:52:59 +09:00
render.h [ui] Create library for UI support code 2021-06-12 22:50:51 +09:00
riff.h Nuke the rcsid stuff. 2012-04-22 10:56:32 +09:00
ringbuffer.h [input] Rework device registration 2021-09-20 15:21:11 +09:00
ruamoko.h [ruamoko] Allow builtins to inc/dec retain count 2020-03-30 16:58:36 +09:00
screen.h [renderer] Continue the job of merging SCR_UpdateScreen 2021-01-11 16:57:31 +09:00
script.h Make script much friendlier to use 2020-02-26 09:39:03 +09:00
segtext.h Document segmented text 2020-02-15 23:48:47 +09:00
set.h [util] Minimize set growth 2021-08-11 12:31:03 +09:00
sizebuf.h [util] Make sizebuf and msg sizes unisgned 2021-04-04 15:53:53 +09:00
skin.h Make header protection consistent 2020-02-24 12:21:20 +09:00
sound.h [audio] Clean up a few minor style issues 2021-06-25 16:52:09 +09:00
spritegn.h Make header protection consistent 2020-02-24 12:21:20 +09:00
sys.h [util] Wrap fd_set 2021-09-28 10:53:51 +09:00
sys_developer.h [util] Make developer flag names easier to manage 2021-03-29 22:38:47 +09:00
teamplay.h Make header protection consistent 2020-02-24 12:21:20 +09:00
tga.h [image] Add parameter to load only the header 2021-01-19 10:15:57 +09:00
va.h [util] Make va return const char * 2021-03-29 17:24:30 +09:00
ver_check.h Make header protection consistent 2020-02-24 12:21:20 +09:00
vid.h [vid] Remove redundant direct, conbuffer and conrowbytes 2021-07-11 13:44:00 +09:00
wad.h Make header protection consistent 2020-02-24 12:21:20 +09:00
wadfile.h Update for doxygen 1.8.16 2020-02-11 15:22:42 +09:00
winding.h Update for doxygen 1.8.16 2020-02-11 15:22:42 +09:00
zone.h [util] Add a function to check hunk pointers 2021-07-29 15:27:48 +09:00