REM Start of BASIC! Program DIALOG.MESSAGE "INKEY$ demo", "What mode of INKEY$ do you want to test?", sel, "Legacy (svar)", "New mode (array)" IF sel = 0 THEN END IF sel = 2 THEN GOTO newmode ?"Legacy: INKEY$ key$" ?"Hit keys on the hard keypad/keyboard, they will be processed when key is released." ?"This mode is ideal for low-level text input." DO INKEY$ key$ IF key$ <> "@" THEN ?key$ PAUSE 1 % allow program to breathe a little UNTIL 0 !============================================ newmode: ?"New mode: INKEY$ keys$[]" ?"Press and maintain direction keys (up, down, left, right) on the hard keypad/keyboard, their pressed or released status will be sent to BASIC! in real time." ?"This mode is ideal for low-level gaming routines." ?"Press this line to enter graphic mode demo." DO PAUSE 1 UNTIL 0 ONCONSOLETOUCH: GR.OPEN 255,0,0,0,1,-1 GR.SCREEN w, h GR.SCALE w/200, h/300 GR.TEXT.SIZE 40 GR.COLOR 255,255,128,128 GR.TEXT.DRAW up, 10, 50, "Up key" GR.TEXT.DRAW down, 10, 100, "Down key" GR.TEXT.DRAW left, 10, 150, "Left key" GR.TEXT.DRAW right, 10, 200, "Right key" GR.TEXT.SIZE 12 GR.COLOR 255,255,255,255 GR.TEXT.DRAW nul, 10, 250, "Touch screen to end demo" DO   INKEY$ keys$[] % if user presses on both up and down, will return ["up", "down"]   ARRAY.SEARCH keys$[], "up", keyUpPressed   IF keyUpPressed THEN GR.SHOW up ELSE GR.HIDE up   ARRAY.SEARCH keys$[], "down", keyDownPressed   IF keyDownPressed THEN GR.SHOW down ELSE GR.HIDE down   ARRAY.SEARCH keys$[], "left", keyLeftPressed   IF keyLeftPressed THEN GR.SHOW left ELSE GR.HIDE left   ARRAY.SEARCH keys$[], "right", keyRightPressed   IF keyRightPressed THEN GR.SHOW right ELSE GR.HIDE right   GR.RENDER   PAUSE 1 % allow program to breathe a little   GR.TOUCH touched, tx, ty UNTIL touched GR.CLOSE ONBACKKEY: END