Detecting M1 key presses

Function

Assigning key data to the M1 key allows the user application program to detect M1 key presses.

Syntax

Detailed Description

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.

Examples

Wait until M1 key pressed
  key 30, "m"
  private waitM1$
waitM1:
  wait 0,&h01                  ' wait for key press
  waitM1$ = inkey$             ' read key data for key pressed
  if waitM1$ <> "m" then       ' if key not M1
    goto waitM1                ' wait for next key press
  endif
  print "M1"
Wait until M2 key pressed
  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"

(C)2002-2004 DENSO WAVE INCORPORATED All right reserved