mirror of
https://github.com/QB64Official/qb64.git
synced 2024-07-05 08:50:25 +00:00
Minor patch to SLEEP and the console, so it only responds with keydown events and not key up events.
This commit is contained in:
parent
eba05938bb
commit
0c1dcaf541
|
@ -15287,11 +15287,12 @@ void sub_put2(int32 i,int64 offset,void *element,int32 passed){
|
||||||
#ifdef QB64_WINDOWS
|
#ifdef QB64_WINDOWS
|
||||||
if (read_page->console){
|
if (read_page->console){
|
||||||
int32 junk=0,junk2=0;
|
int32 junk=0,junk2=0;
|
||||||
|
do{ //ignore all console input unless it's a keydown event
|
||||||
do{ //ignore all console input
|
do{ //ignore all console input uless it's a keyboard event
|
||||||
junk=func__getconsoleinput();
|
junk=func__getconsoleinput();
|
||||||
junk2=consolekey;
|
junk2=consolekey;
|
||||||
}while(junk!=1); //until we have a key down event
|
}while(junk!=1); //only when junk = 1 do we have a keyboard event
|
||||||
|
}while(junk2<=0); //only when junk2 > 0 do we have a key down event. (values less than 0 are key up events; 0 is a non event)
|
||||||
do{ //now continue to get the console input
|
do{ //now continue to get the console input
|
||||||
junk=func__getconsoleinput();
|
junk=func__getconsoleinput();
|
||||||
}while(consolekey!=-junk2); //until that key is released. We don't need to leave the key up sequence in the buffer to screw things up with future reads.
|
}while(consolekey!=-junk2); //until that key is released. We don't need to leave the key up sequence in the buffer to screw things up with future reads.
|
||||||
|
|
Loading…
Reference in a new issue