QB64.org Forum
Active Forums => QB64 Discussion => Topic started by: Cobalt on September 28, 2019, 03:28:41 pm
-
is there anyway to monitor for any keyboard input via _KEYDOWN? or does it have to monitor for explicit key codes?
as in; Nul=_KEYDOWN(20480)
or is there an option I'm missing like; Nul = _KEYDOWN(*)
where '*'=wildcard
something I could use it to processes an input handler when any key is held down, When I use INKEY$ or _KEYHIT there is often a pause before the routine called by my _KEYDOWN line does its thing.
I am wondering if I could pull this code off:
so my program doesn't waste a lot of time looking for any keys down unless there is one to find. And without the pause that seem inherent when using either _KEYHIT or INKEY$ to watch for it.
-
I’d keep checking the required keys alone. No such burden on the processor.
-
I’m thinking _DEVICES would be the easiest way to go to do this.
devices = _DEVICES
DO
If _DEVICEINPUT = 1 THEN Input_Controls ‘keyboard input
LOOP
SUB Input_Controls
IF _BUTTON(uparrowcode) THEN do something
IF _BUTTON(leftarrowcode) THEN do something else
...
...
...
IF _BUTTON(65) THEN do something magical with Capital “A”.
...
...
... so on and so on
END SUB