Is it possible for AHK to act when two keys are pressed simultaneously?

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
User avatar
DavidP
Posts: 225
Joined: 10 Aug 2014, 07:31

Is it possible for AHK to act when two keys are pressed simultaneously?

17 Jan 2019, 12:39

Hi Forum,

can Autohotkey detect keys that are pressed simultaneously?

Say, I press the keys "A" and "B" simultaneously, can AHK detect that?

Like:

Code: Select all

AB::SoundBeep
User avatar
DavidP
Posts: 225
Joined: 10 Aug 2014, 07:31

Re: Is it possible for AHK to act when two keys are pressed simultaneously?

17 Jan 2019, 12:45

Found it:
https://autohotkey.com/docs/Hotkeys.htm#combo

Code: Select all

A & B::SoundBeep
However, this way I seem to loose the "A" key because it is turned into a modifier :eh:
User avatar
DavidP
Posts: 225
Joined: 10 Aug 2014, 07:31

Re: Is it possible for AHK to act when two keys are pressed simultaneously?

17 Jan 2019, 13:39

Thanks.

Strangely, this line made all SoundPlay lines in the script completely defunct for some reason :eh:
User avatar
Scr1pter
Posts: 1272
Joined: 06 Aug 2017, 08:21
Location: Germany

Re: Is it possible for AHK to act when two keys are pressed simultaneously?

17 Jan 2019, 18:51

Try

Code: Select all

~a & b::
SoundBeep
return
Cheers!
Please use [code][/code] when posting code!
Keyboard: Logitech G PRO - Mouse: Logitech G502 LS - OS: Windows 10 Pro 64 Bit - AHK version: 1.1.33.09

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Descolada and 307 guests