This only deals with buttons being held, so won't cause
performance issues.
This deals with a general problem of the input layer:
you can query the current state of the inputs, but inputs
are received in a queue, causing inconsistencies.
This is why pressing enter during a load, then holding Alt
after pressing it, causes the game to switch fullscreen
after the load finishes; checking for "alt-enter" should
be checking if Alt was pressed when Enter was pressed,
not whether it's pressed right now.
Similarly, CodeDetector has difficulty handling a "Right-Left"
and a "Left-Right" code simultaneously. If both buttons
are pressed quickly, it needs to check whether Right was
pressed at the time Left was reported, not at the time
EnteredCode was called.
not the time corresponding to the current input state. (If
debouncing delays reporting an input, m_BeingHeldTime
refers to the time of the delayed input.) Add m_LastInputTime,
which remembers the timestamp of the last reported input.
- This reduces the number of types associated with input; adding a
distinct input type doesn't introduce a whole new enumerated type
and related functions.
- Special handling for different devices is needed less often. If you
want to respond to an F1 press, simply check for KEY_F1; the device
type doesn't really matter (though it'll usually be a keyboard).
- This allows cleaner support for generalized USB devices. While they're
usually of the traditional classes (keyboard, joystick) with associated
inputs, they don't have to be.
- Forced casts between parallel types can be removed, and weakly-specified
variables (ints instead of the enum type) can be fixed.
Some things that might have been merged havn't; for example, arrow keys
on a keyboard (KEY_UP) are still distinct from axes on a joystick (JOY_UP).
These may or may not be merged in the future.
Some were: removed PUMP_ symbols. Treat them as generic buttons, and just
give them names with GetDeviceSpecificInputString. It's not worth
introducing more special names for something only used in one place.
it was waiting g_fTimeBeforeSlow+g_fTimeBetweenRepeats, ignoring the
first repeat). Adjust TIME_BEFORE_SLOW_REPEATS so the rate doesn't
actually change. Set correct timestamps for IET_REPEAT events.