FB II Compiler

PG PRO

Debugging

Memory

System

Mathematics

Resources

Disk I/O

Windows

Controls

Menus

Mouse

Keyboard

Text

Fonts

Drawing

Sound

Clipboard

Printing

Communication

ASM

Made with FB

KEYBOARD

Test for the spacebar


compile 0,_dimmedVarsOnly _CaseInsensitive

DIM IsSpaceDown
END GLOBALS

LOCAL FN dokeys
DIM KeyRec(7)
DIM KeySpaceBar
CALL GETKEYS(KeyRec(0))
KeySpaceBar = FN BITTST(#@KeyRec(3),06) '512
END FN = KeySpaceBar

window #1,"Space Test",(0,0)-(320,200)
DO
  IsSpaceDown = FN dokeys
  LONG IF IsSpaceDown<>0
  PRINT "SpaceBar is down."
 XELSE
  PRINT "SpaceBar is up."
 END IF
 HANDLEVENTS
UNTIL FN BUTTON

TJ Grant