why doesn't GETKEY work with WAIT (solved)
|
10-26-2015, 07:31 AM
(This post was last modified: 10-26-2015 12:32 PM by StephenG1CMZ.)
Post: #1
|
|||
|
|||
why doesn't GETKEY work with WAIT (solved)
I expected this simple program to buffer key input, allowing tapping ESC to exit: it doesn't when WAIT is included, so I have to exit by holding ON to interrupt the program instead.
Is there a better way?,[Android] Code:
Stephen Lewkowicz (G1CMZ) https://my.numworks.com/python/steveg1cmz |
|||
10-26-2015, 08:24 AM
Post: #2
|
|||
|
|||
RE: why doesn't GETKEY work with WAIT
When you press a key WAIT(-1) returns the key code, you don't need GETKEY after that.
Try to replace: Code: REPEAT Code: REPEAT UNTIL WAIT(−1)==4 ; |
|||
10-26-2015, 09:58 AM
Post: #3
|
|||
|
|||
RE: why doesn't GETKEY work with WAIT
WAIT(-1) itself also captures key presses. So if you press [Esc] during the WAIT(-1) timeout period, the keypress is sent to the WAIT command. GETKEY would then have nothing in the buffer to parse. Save the output from WAIT(-1) and use it to test.
Graph 3D | QPI | SolveSys |
|||
10-26-2015, 12:36 PM
Post: #4
|
|||
|
|||
RE: why doesn't GETKEY work with WAIT (solved)
Thanks. I never thought of looking for the key hidden in WAIT.
Stephen Lewkowicz (G1CMZ) https://my.numworks.com/python/steveg1cmz |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 3 Guest(s)