KeyBoardState
KeyBoardState KeyArray()
 
Parameters:

    KeyArray() = An integer array to store the key state values in (needs to 255 at least in size)
Returns: NONE
 

      KeyBoardState returns the current state of all the keys on your keyboard. The key state values are exported for return in a passed integer array. The array should be at least 255 in size.



FACTS:


      * Can detect if more than one key is pressed. Note: Most keyboards can only register a max of 5/6 keys pressed a one time.




Mini Tutorial:



  
  
  Dim Keys(255)
  
  
  Do
     Cls RGB(0,0,0)
     Print "Keys Pressed"
     
   ;  Get the current state of all the keyus on the key baord
     KeyBoardState Keys()
     
   ; run through and chekc what key codes were pressed
     For lp=0 To 255
        If Keys(lp)=true
           Print "Scancode Was pressed:"+Str$(lp)
        EndIf
     Next
     
     
     Sync
  Loop
  
  



This example would output the following if your holding the A + Space Keys down.

  
  Keys Pressed
  ScanCode Was pressed:30
  ScanCode Was pressed:57
  

 
Related Info: KeyState | Scancode :
 


(c) Copyright 2002 - 2024 - Kevin Picone - PlayBASIC.com