What code do i use for (this) button in AHK?

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
someguyinKC
Posts: 66
Joined: 25 Oct 2018, 11:33

What code do i use for (this) button in AHK?

27 Jul 2021, 07:46

I am trying to figure out what AHK perceives as a press of a certain key. Is there a simple (or even not so simple) way to figure out what to put into AHK for a certain key? (the key I am looking to define is a button on a USB device)
User avatar
boiler
Posts: 17105
Joined: 21 Dec 2014, 02:44

Re: What code do i use for (this) button in AHK?

27 Jul 2021, 08:03

It may not register as a key or key combination, but if it does, you can find out what it registers as by running this script which will show you the key history:

Code: Select all

#UseHook
MsgBox, Press the key of interest then click OK below to see key history.`n`nAfter viewing the key history, press Esc to exit script.
KeyHistory
return

Esc::ExitApp
someguyinKC
Posts: 66
Joined: 25 Oct 2018, 11:33

Re: What code do i use for (this) button in AHK?

27 Jul 2021, 12:46

I'm looking for the below highlighted key.
image.png
image.png (47.24 KiB) Viewed 299 times
is it unusable in AHK if it says "not found" for the key? or does the fact that it shows up as VK=FF and SC=101 mean that i can use it somehow?
Attachments
image.png
image.png (47.24 KiB) Viewed 299 times
thank you,

Someguy
gregster
Posts: 9068
Joined: 30 Sep 2013, 06:48

Re: What code do i use for (this) button in AHK?

27 Jul 2021, 13:04

Not sure, but perhaps it is just the key name that is not found. I would try

Code: Select all

SC101::msgbox yes
Edit: The AHK docs say that vkFF 'is reserved to mean "no mapping" (a key which has no function)' by Microsoft - doesn't sound good. I would still try the scan code SC101.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Bing [Bot] and 145 guests