AltKeys
State = AltKeys(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 AltKeys() function will return the state of either ALT key upon your keyboard.

      Since these 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 a key is being pressed, the function will return a value of 1 (True), if it's not being pressed, it will return a zero (False.

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:


      * Windows uses the ALT keys as way to change processes (programs), so it's really not recommended you use these keys for program controls.





Mini Tutorial:


      This example shows how To Read the various common keys.

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




 
Related Info: BreakKey | CtrlKeys | Downkey | EnterKey | FunctionKeys | GetBreakKey :
 


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