Proof of concept
Algorithm to map multiple input events to actions.
- Input event
- One raw event (e.g., key press, mouse down, etc)
- Input event sequence
- Sequence of input events
- Input event binding
- Input event sequence, action and context
- Input event map
- List of input event bindings
- Input event handler
- Dictionary of input event map and context
- Action
- Unique identifier with arguments
- Context
- Identifier to distinguish each context
- Context stack
- Stack of contexts
See main.cpp
for details.
Bindings:
x
=> action xx
,x
=> action xxx
,y
=> action xyz
=> action z
Input:
x
,x
=> action xxx
,y
=> action xyx
,z
=> action x, action zx
, timeout => action x