Assigning key data to the M1 key allows the user application program to detect M1 key presses.
By default, the INKEY$ function cannot detect M1 key presses because the key has no key data assigned to it. The program must first assign any string with a KEY statement.
The same applies to the M2 key.
For further details on key numbers, refer to Appendix E "Key Number Assignment on the Keyboard" in the BHT-BASIC Programmer's Manual.
"m" then ' if key not M1 goto waitM1 ' wait for next key press endif print "M1"
key 31, "n" private waitM2$ waitM2: wait 0,&h01 ' wait for key press waitM2$ = inkey$ ' read key data for key pressed if waitM2$ <> "n" then ' if key not M2 goto waitM2 ' wait for next key press endif print "M2"