Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
reading simultaneous keys pressed
#6
It seems we crospost. Let me repeat here:

The snippet is not working, that's right, because I forgot you have to check simultaneously KEYS in the same semirow (look at the ZX Spectrum keyboard layout).
E.g. The following will work:
Code:
#include <keys.bas>

DO
IF MultiKeys(KEYA| KEYS) THEN : REM 'A' and 'S' are in the same semirow
    PRINT AT 0, 0; "Letter A or letter S pressed (or both)"
ELSE
    PRINT AT 0, 0,,
END IF
LOOP : REM Repeat forever since no condition specified
To check ANY key use MultiKeys(<key 1>) AND MultiKeys(<Key 2>) so you don't have to care about rows, positions, etc...
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)