guides:programming:programmers_reference_manual:asynckeystate_property_system

ASYNCKEYSTATE property (System)

Returns the state of a key at the time the property is accessed. The key to check is passed as a virtual-key code in the index parameter.

This property is an integer value that represents a set of bit flags. As a general rule:

• If the key is pressed down the property returns a value < 0.

• If the key is not pressed 0 is returned.

• If the key is not pressed but has been since the last ASYNCKEYSTATE call, then 1 is returned.

See remarks for more information.

DevelopmentRuntimeIndexedScaledSynthetic
N/AGetYesNoNo

This property is essentially a wrapper around the GetAsyncKeyState Windows API function, so please refer to the documentation on the Microsoft website for further information, especially regarding some caveats regarding the value returned.

Virtual-key code constants are defined in the MSWin_VirtualKey_Equates insert record.

 
// Get the state of the Shift key

   

   $Insert MSWin_VirtualKey_Equates

   

   ShiftDown = ( Get_Property( "SYSTEM", "ASYNCKEYSTATE", VK_SHIFT$ ) < 0 )
 
 
 

KEYSTATE property

  • guides/programming/programmers_reference_manual/asynckeystate_property_system.txt
  • Last modified: 2023/10/25 10:49
  • by 127.0.0.1