I’m trying to implement an “always-ready-to-go” walk-mode which gets activated as soon as W/A/S/D key is pressed, and gets deactivated as soon as the key is released. This way, the samee key used for navigating in walk-mode will also dynamically engage and disengage the walk-mode. (As pressing shift+` to engage walk mode and then navigate, and then exiting walk mode to perform other operations breaks the flow)
For this I’ve done the following:
- Mapping the W/A/S/D key PRESS to view3d.walk()
- Mapping the W/A/S/D key RELEASE to confirm (i.e exit) walk mode
The problem I’m facing is:
Pressing and holding the W key results in a half-second delay between when walk mode is activated, and when the movement actually starts.
This results in having to wait for each walk mode interaction to initiate…
Alternatively, when the W key is pressed, immediately released, and then pressed again, this delay seems to be absent and the movement is engaged right-away.
I’m not sure whether this behavior is caused by some wait condition attached to pressing and holding a key, or if it’s a specific issue related to walk mode’s invoke function etc.
I’m looking to understand what’s causing this behavior and how it can be fixed, either by trying an entirely different approach or by poking around in the C code, if it can be fixed there… Any help is much appreciated.