Recall last letter pressed among a certain set of letters Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
ouboss
Posts: 21
Joined: 10 Dec 2016, 04:24

Recall last letter pressed among a certain set of letters

22 May 2018, 20:07

Is it possible to recall which letters have been pressed last whether they were sent via keyboard or a script? Perhaps something similar to A_priorkey but just a certain subset of letters. I'm not quite sure where to begin with this one.

E.g.

I want the last pressed of either a or b. If I typed "absdkfjkj" it would produce b instead of j. Ultimately it will be used to send additional letters according to whether a or b came more recently.
imustbeamoron
Posts: 44
Joined: 18 Aug 2016, 22:56

Re: Recall last letter pressed among a certain set of letters  Topic is solved

22 May 2018, 21:56

probably a better way, but maybe something like this?

Code: Select all

LoggedKeys := ["A","B","Z"]
for k, v in LoggedKeys
	Hotkey, % "~"LoggedKeys[k], LogKey

LogKey:
LastLoggedKey := StrReplace(A_ThisHotkey, "~")
ToolTip % LastLoggedKey
return
ouboss
Posts: 21
Joined: 10 Dec 2016, 04:24

Re: Recall last letter pressed among a certain set of letters

23 May 2018, 09:30

Was able to build on your foundation to piece together exactly what I had envisioned to create at the start. Also had a few ah HA, eureka learning moments while doing so. Thanks for that. :beer:

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: mikeyww, Sarhad and 299 guests