Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AutoHotKey: Getting the last key that was pressed

Tags:

autohotkey

I'd like to get the last key that was pressed by the user. I'm not talking about a hotkey; just a normal keypress.

If possible, I'd also like to have keys that AHK typed using SendInput be included. So if AHK just did SendInput for some keys, and I'm asking for the last key that was pressed, then I'd be given the last key that AHK emitted or the last key that the user typed, depending on who typed last.

I tried A_PriorKey, but it's problematic because when I tried it, it showed one of the keys that triggered the script, rather than the keys that came before the hotkeys, which is what I want.

Is what I want possible?

like image 744
Ram Rachum Avatar asked Nov 02 '22 21:11

Ram Rachum


1 Answers

Have you tried a loop with Input, LastKey, L1 V ?

like image 53
Robert Ilbrink Avatar answered Jan 04 '23 15:01

Robert Ilbrink