Project

General

Profile

Bug #573

Inkey$ captures previous input character

Added by Paul Kitching over 3 years ago. Updated about 3 years ago.

Status:
Closed
Priority:
Normal
Target version:
-
Start date:
11/16/2020
Due date:
% Done:

0%

Estimated time:
Affected version:

Description

If you just press return this shouldn't print "not blank", but it does. Temp2 contains the return char so tests for an empty string fail:

#manifest: "aoz"
input temp$
wait 1
temp2$=inkey$
if temp2$<>"" then print "not blank"
wait key
end

I put in a wait just to prove it wasn't getting the key from the speed of it running when the key is still pressed from the input line.

#1

Updated by Paul Kitching over 3 years ago

Putting in a CLEAR KEY doesn't get rid of it, and neither does setting the variable to "".
The only way I can get rid of it is to put in a WAIT KEY that accepts it (and therefore doesn't wait).

#2

Updated by Paul Kitching about 3 years ago

  • Status changed from New to Closed

This is now working.

Also available in: Atom PDF