
This is the state that the OS and the active window believe the key to be in, but is not necessarily the same as the physical state.Īlternatively, one of these letters may be specified:

If omitted, the mode will default to that which retrieves the logical state of the key. This parameter is ignored when retrieving joystick status. Known limitation: This function cannot differentiate between two keys which share the same virtual key code, such as Left and NumpadLeft. The virtual key code of such a key can be determined by following the steps at the bottom of the key list page. This is useful in the rare case where a key has no name. Examples: B, 5, LWin, RControl, Alt, Enter, Escape, LButton, MButton, Joy1.Īlternatively, an explicit virtual key code such as vkFF may be specified. This can be just about any single character from the keyboard or one of the key names from the key list, such as a mouse/joystick button. GetKeyState() KeyIsDown := GetKeyState(KeyName, Mode) GetKeyState() / GetKeyState - Syntax & Usage | AutoHotkey GetKeyState() / GetKeyStateĬhecks if a keyboard key or mouse/joystick button is down or up.
