Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 22:28 12 May 2026 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : PicoCalc MMBasic: No KEYDOWN?

Author Message
BASIC_bro
Newbie

Joined: 11/05/2026
Location: United States
Posts: 3
Posted: 03:47am 11 May 2026
Copy link to clipboard 
Print this post

Hello, attempting to write something in MMBasic on a PicoCalc, "inkey" looked like the way to go.

After seeing it missed some keys, more searching returned "keydown", but that always returns 0.  "Option explicit" suggests it doesn't exist in this version of MMBasic, and is being interpreted as a variable:
" Error : KEYDOWN is not declared"

mm.ver returns 6.0002

Oddly, inkey returns a code for the arrow keys and for delete, but not backspace.
Per the manual, that looks to be expected.
https://geoffg.net/Downloads/picomite/PicoMite_User_Manual.pdf

Is keydown's absence a bug, a case of "we're not done porting" or a feature deliberately left out of the PicoCalc version of MMBasic?

If keydown will not be added, is there/will there be a way to read backspace through inkey or another language feature?

Thanks!
 
ville56
Guru

Joined: 08/06/2022
Location: Austria
Posts: 471
Posted: 04:33am 11 May 2026
Copy link to clipboard 
Print this post

from the manual:

KEYDOWN(n) Return the decimal ASCII value of the keyboard key that is currently held
down or zero if no key is down. This function applies to USB keyboards and
PS2 keyboards (in MMBasic 6.02.01 or later).


You have version 6.00.02 ...
                                                                 
73 de OE1HGA, Gerald
 
Frank N. Furter
Guru

Joined: 28/05/2012
Location: Germany
Posts: 1089
Posted: 06:37am 11 May 2026
Copy link to clipboard 
Print this post

...and you don't have a USB or PS/2 keyboard! This keyboard works via I2C...

Frank
Edited 2026-05-11 16:38 by Frank N. Furter
 
BASIC_bro
Newbie

Joined: 11/05/2026
Location: United States
Posts: 3
Posted: 11:05pm 11 May 2026
Copy link to clipboard 
Print this post

Thanks to both of you for your responses.

My confusion probably came from having opened several copies of the manual.

In one (the appropriate one), keydown isn't even mentioned.

I don't remember reading about USB/PS2, which means I probably had
https://fruitoftheshed.com/wiki/lib/exe/fetch.php?media=mmbasic_hardware:mmb4w_user_manual_v0.97.pdf
open.  Had I scrolled up on that copy, I'd have seen "MMBasic for Windows".  (I might have, and seeing version 5, may have assumed all MMBasic 6s would have it.)

https://mmbasic.com/Download/MMBasic%20Language%20Manual.pdf
has keydown in version 4.5, but does mention a PS2 keyboard.

As for what I was writing, it's working fine, using the delete key for backspace as a stopgap.

Will look into a few of the other languages available for the PicoCalc to see which allow capturing all keys, and paying attention to the versions this time!
 
BASIC_bro
Newbie

Joined: 11/05/2026
Location: United States
Posts: 3
Posted: 03:40am 12 May 2026
Copy link to clipboard 
Print this post

A little more digging, and MMBasic will do what I was hoping.

ON KEY 8, HandleBackspace
...
SUB HandleBackspace()
 PRINT "B"
END SUB

Though if you break execution, backspace won't work (del will) until the interrupt is cleared.
ON KEY 8, 0

(Though the interrupt blocks the normal operation of backspace, it does not print B anymore once the program is halted.)
 
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2026