Navigation:  thinBasic Modules > UI (User Interface) > Keyboard >

GetWindowKeyState

Previous pageReturn to chapter overviewNext page

 

Description

 

Determines whether a key is up or down at the time the function is executed.

Function check if hWnd handle is the active window. If not, function will return %FALSE even if the requested key is pressed.

 

Syntax

 

n = GetWindowKeyState(hWnd, vKey)

 

Returns

 

Number: %TRUE or %FALSE.

 

Parameters

 

Name

Type

Optional

Meaning

hWnd

Number

No

Handle of the window to check if currently active

vKey

Number

No

Specifies one of then 256 possible virtual-key codes. For more information, see Virtual-Key Codes

 

Remarks

 

Use GetWindowKeyState with vKey equal to -1 to reset keys flags

 

Restrictions

 

See also

 

Examples