This should detect a space bar press, when other keys are held down like arrow key combinations. It does, except in the code snippet below...
If you hold down the ARROW UP and ARROW LEFT keys at the same time, and press the space bar, you won't hear the sound. Other combos like arrow up and arrow right held down while pressing the space bar will produce the sound.
So what's up? I further tested noted in my QB64 version 2.1 Development Build that the software is blocking INKEY$, _KEYHIT, and _KEYDOWN from registering CHR$(32). the space bar, under some key combination conditions, but not others.
Change CHR$(32) to CHR$(9), no problem.
Change INKEY$ to _KEYHIT = 32 and it gets blocked again.
Same issue with _KEYDOWN (I swapped out sound for print to avoid annoying build up of sound.)
Any ideas as to why, or is this a bug that's been fixed in a newer version?
Pete
If you hold down the ARROW UP and ARROW LEFT keys at the same time, and press the space bar, you won't hear the sound. Other combos like arrow up and arrow right held down while pressing the space bar will produce the sound.
So what's up? I further tested noted in my QB64 version 2.1 Development Build that the software is blocking INKEY$, _KEYHIT, and _KEYDOWN from registering CHR$(32). the space bar, under some key combination conditions, but not others.
Code: (Select All)
DO
IF INKEY$ = CHR$(32) THEN SOUND 1000, .2 ' Fails detection while holding down arrow up and arrow left keys.
LOOP
Change CHR$(32) to CHR$(9), no problem.
Code: (Select All)
DO
IF INKEY$ = CHR$(9) THEN SOUND 1000, .2 ' Works with all one or two arrow key combinations, including arrow up + arrow left.
LOOP
Change INKEY$ to _KEYHIT = 32 and it gets blocked again.
Code: (Select All)
DO
IF _KEYHIT = 32 THEN SOUND 1000, .2 ' Works with all one or two arrow key combinations, including arrow up + arrow left.
LOOP
Same issue with _KEYDOWN (I swapped out sound for print to avoid annoying build up of sound.)
Code: (Select All)
DO
_LIMIT 30
IF _KEYDOWN(32) = -1 THEN PRINT _KEYDOWN(32); ' Works with all one or two arrow key combinations, including arrow up + arrow left.
LOOP
Any ideas as to why, or is this a bug that's been fixed in a newer version?
Pete