script running only when a hardware key is pressed manually? Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
surfactant
Posts: 99
Joined: 28 Jun 2019, 01:07

script running only when a hardware key is pressed manually?

Post by surfactant » 25 Jul 2021, 23:00

I have a special desktop software, in which openning a new file would trigger an action of pressing RAlt sometimes. This makes me impossible to use the key RAlt in a reliable way.

Is it possible to make a script running only when the hardware key RAlt is pressed manually, but not triggered by a software? Thanks!

swagfag
Posts: 6222
Joined: 11 Jan 2017, 17:59

Re: script running only when a hardware key is pressed manually?  Topic is solved

Post by swagfag » 26 Jul 2021, 02:10

Code: Select all

????::
	if !GetKeyState(????, "P")
		return
	
return

surfactant
Posts: 99
Joined: 28 Jun 2019, 01:07

Re: script running only when a hardware key is pressed manually?

Post by surfactant » 26 Jul 2021, 04:07

@swagfag It works. Thank you!

Post Reply

Return to “Ask for Help (v1)”