Read input when window is not active?

BlitzPlus Forums/BlitzPlus Programming/Read input when window is not active?

I first tried Blitz+'s HotKeyEvent command, but it wouldn't work once the app was minimized. I came up with an userlib solution that will work, I just don't know about using a combination of keys with it. I'm pretty sure modifiers can be detected with this function, so search around and hopefully you can find a solution

; Required Userlib
; .lib "user32.dll"
; GetAsyncKeyState%(vKey%)
win = CreateWindow("Minimize me and hit F10", 100, 100, 250, 100, 0, 1 + 2)

AutoSuspend 0
CreateTimer 60
Repeat
	
Select WaitEvent()
	Case $803: Exit
	
	Case $4001
	; Uncomment to determine a hotkey code
	;For i = 0 To 255 
	;	ret% = GetAsyncKeyState(i)
	;	If ret% Then RuntimeError "Hotkey code is " + Str(i)
	;Next

	If GetAsyncKeyState(121) Then RuntimeError "Hotkey detected" ; F10 Hotkey
	Delay 5

End Select
Forever
Oh, and I almost forgot to mention this does not capture the key, other apps will still receive it after you're done with it.