This bug is dead simple, I'm trying to detect whether or not a SHIFT+A key or just A key is being pressed.
Here is the code:-
For some reason detecting the shift keys is going to keyhit, which if you bash both shift and A together, sometimes you will get a capital A.
If I take FlushKeys out then everything works fine, but this is stupid as I am calling FlushKeys AFTER all my key checks.
Here is the exact same code working fine in oldskool Blitz.
Here is the code:-
Graphics 400,400 Global plop:String = "No Key" Global shiftdown:Int = 0 Repeat If KeyDown(KEY_LSHIFT) Or KeyDown(KEY_RSHIFT) Then shiftdown = 1 Else shiftdown = 0 EndIf If KeyHit(KEY_A) Then Select shiftdown Case 0;plop = "Lowercase A" Case 1;plop = "Uppercase A" End Select EndIf FlushKeys() Cls DrawText "KEY = "+plop,50,50 DrawText "SHIFT ="+shiftdown,50,70 Flip Until KeyDown(KEY_ESCAPE) End
For some reason detecting the shift keys is going to keyhit, which if you bash both shift and A together, sometimes you will get a capital A.
If I take FlushKeys out then everything works fine, but this is stupid as I am calling FlushKeys AFTER all my key checks.
Here is the exact same code working fine in oldskool Blitz.
Graphics 400,400,0,2 Global plop$ = "No Key" Global shiftdown = 0 Repeat If KeyDown(42) Or KeyDown(54) Then shiftdown = 1 Else shiftdown = 0 EndIf If KeyHit(30) Then Select shiftdown Case 0:plop = "Lowercase A" Case 1:plop = "Uppercase A" End Select EndIf FlushKeys() Cls Text 50,50,"KEY = "+plop Text 50,70,"SHIFT ="+shiftdown Flip Until KeyDown(1) End