Windows API reference
GetAsyncKeyState
Retrieves the status of a virtual key, including whether it is currently down and whether it was pressed since the previous call.
- Library
- User32.dll
- Category
- Spying
- Suspicion
- high
- MITRE ATT&CK
- T1056.001 Input Capture: Keylogging
Detection summary
GetAsyncKeyState has no reviewed Sysmon/ETW event; key polling is detected through EDR hooks, call stacks and behavioral analysis.
- Sysmon: No Sysmon event mapped
- ETW: No ETW provider mapped
- Notes: Use EDR user-mode hooks or polling analysis and correlate with SetWindowsHookEx, GetKeyboardState or GetKeyState. The reviewed Sysmon event set does not record the key-state query.
Sources and documentation
- Microsoft Learn documentation (direct documentation)
- MITRE ATT&CK T1056.001: Input Capture: Keylogging
- Microsoft Sysmon events
Last reviewed: . Page metadata generated .
Legitimate use
Games, input remapping, accessibility tools, macro utilities, UI automation and remote-control software.
Related APIs
- GetKeyState — User32.dll
- GetKeyboardState — User32.dll
- SetWindowsHookExW — User32.dll