QB64 bug or exception?
#1
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.

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
Reply


Messages In This Thread
QB64 bug or exception? - by Pete - 10-03-2022, 07:30 AM
RE: QB64 bug or exception? - by RhoSigma - 10-03-2022, 07:49 AM
RE: QB64 bug or exception? - by Pete - 10-03-2022, 11:11 AM
RE: QB64 bug or exception? - by James D Jarvis - 10-03-2022, 11:11 AM
RE: QB64 bug or exception? - by Pete - 10-03-2022, 11:19 AM
RE: QB64 bug or exception? - by James D Jarvis - 10-03-2022, 11:25 AM
RE: QB64 bug or exception? - by bplus - 10-03-2022, 02:46 PM
RE: QB64 bug or exception? - by TerryRitchie - 10-03-2022, 03:35 PM
RE: QB64 bug or exception? - by Pete - 10-03-2022, 05:22 PM
RE: QB64 bug or exception? - by James D Jarvis - 10-03-2022, 11:44 PM
RE: QB64 bug or exception? - by Pete - 10-04-2022, 12:10 AM
RE: QB64 bug or exception? - by James D Jarvis - 10-04-2022, 12:35 AM
RE: QB64 bug or exception? - by Pete - 10-04-2022, 12:52 AM
RE: QB64 bug or exception? - by mnrvovrfc - 10-04-2022, 02:05 AM



Users browsing this thread: 7 Guest(s)