ShiftKeys
State = ShiftKeys(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 ShiftKeys() function will return the state of either SHIFT 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.

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 XP users should note that using pressing SHIFT key a number of times can envoke Windows Sticky Key settings.



Mini Tutorial:


This example shows how To Read the various common keys.

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




 
Related Info: ALtKeys | BreakKey | Downkey | EnterKey | Esckey | FunctionKeys | KeyState | Leftkey | Rightkey | Scancode | Upkey | WindowsKeys :
 


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