I am developing an app and want to be able to detect if user pressed backspace or delete key in any other application but am not having any luck.
Saw some keylogger code which does pick up characters but it also doesn't capture backspace key presses. Thank you!
# Backspace is 0x08
for ($ascii = 1; $ascii -le 254; $ascii++) {
# get current key state
$state = $API::GetAsyncKeyState($ascii)
write-host "ascii $ascii $state"
# is key pressed?
if ($state -eq -32767) {
$null = [console]::CapsLock
# translate scan code to real code
$virtualKey = $API::MapVirtualKey($ascii, 3)