CtrlKeys
State = CtrlKeys(KeySelector)
 
Parameters:

    KeySelector = Flag to select if BOTH or only the LEFT or RIGHT keys are checked
Returns:

    State = The state of the key (0= up, 1 = pressed)
 

      The CtrlKeys() function with return the state of either CONTROL key upon your keyboard.

      Since the CTRL keys are commonly used as game controls, they have their own dedicated command. Purely to make things easy to remember and your code easier to read.

      If the key is being pressed, the function will return a value of 1 (True), if it's not being pressed, it will return a zero.

Key Selector Flags:

      0 = Return the state of either LEFT/RIGHT or Key
      1 = Return the state of only the LEFT Key
      2 = Return the state of only the RIGHT Key




FACTS:


      * None



Mini Tutorial:


      This example shows how To Read the various common keys.

  
  Do
     Cls RGB(0,0,0)
     
   ; Display the Status of the CONTROL keys
     Print "Combined CTRL Key State:"+Str$(CtrlKeys(0))
     Print "Left CTRL Key State:"+Str$(CtrlKeys(1))
     Print "Right CTRL Key State:"+Str$(CtrlKeys(2))
     
   ; Display the Screen and wait for the user to press a key
     Sync
  Loop
  
  




 
Related Info: AltKeys | BreakKey | Downkey | EnterKey | Esckey | FlushKeys | FunctionKeys | KeyState | Scancode | WindowsKeys :
 


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