The following warnings occurred:
Warning [2] Undefined array key 0 - Line: 1677 - File: showthread.php PHP 8.2.31 (Linux)
File Line Function
/inc/class_error.php 157 errorHandler->error
/showthread.php 1677 errorHandler->error_callback
/showthread.php 916 buildtree




Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
reading simultaneous keys pressed
#2
Use the multikeys function in the library which returns non zero (True) if ANY of the given keys is pressed.
Code:
#include <keys.bas> DO IF MultiKeys(KEYSPACE | KEYENTER) THEN PRINT "Space or Enter pressed" END IF LOOP : REM Repeat forever since no condition specified
Predefined key constants are in the KEY.BAS file. Read there.

Notice you can use | as in C or bOR to test for multiple values simultaneously.
So the above test checks for ENTER or SPACE pressed.
The function is much faster than INKEY$ and can check multiple keys pressing (limited by the ZX hardware)
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)