KEYCODE instruction operation in FemtoBasic?
Duane C. Johnson
Posts: 955
I am trying to us the KEYCODE instruction in FemtoBasic.
Well, I'm actually running DongleBasic. I want to read a single ascii code
representing the keystroke from the serial port or "0" for an empty buffer
KEYCODE
The value of the next keyboard key value or zero if the keyboard buffer is empty.
I guess I don't understand how this works.
Do you have any examples of how to use this.
It seems like I have tried everything but all I get is an error like this:
10 A = KEYCODE
IN LINE 10 Syntax Error
or
10 PRINT KEYCODE
IN LINE 10 Syntax Error
or
10 IF KEYCODE <> 0 THEN PRINT "x"
IN LINE 10 Syntax Error
but
10 KEYCODE
works but where do I find the code?
What am I doing wrong?
Duane
Well, I'm actually running DongleBasic. I want to read a single ascii code
representing the keystroke from the serial port or "0" for an empty buffer
KEYCODE
The value of the next keyboard key value or zero if the keyboard buffer is empty.
I guess I don't understand how this works.
Do you have any examples of how to use this.
It seems like I have tried everything but all I get is an error like this:
10 A = KEYCODE
IN LINE 10 Syntax Error
or
10 PRINT KEYCODE
IN LINE 10 Syntax Error
or
10 IF KEYCODE <> 0 THEN PRINT "x"
IN LINE 10 Syntax Error
but
10 KEYCODE
works but where do I find the code?
What am I doing wrong?
Duane
Comments
Duane