How do I fire a hotkey with a control key held down?

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Derek Morin
Posts: 2
Joined: 17 Nov 2017, 06:57
Contact:

How do I fire a hotkey with a control key held down?

17 Nov 2017, 07:00

How do I fire a hotkey with a control key held down?

For example - I am trying to fire something with Control + Alt + Up, but I want to be able to do it repeatedly while holding down control and alt, but pressing the up key.

I'd like it to fire when the Up key goes up.
Rohwedder
Posts: 7647
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: How do I fire a hotkey with a control key held down?

17 Nov 2017, 08:19

Hallo,
try:

Code: Select all

^!Up::Send, fire
^!Up Up::Send, fire
Guest

Turns out it was my own sillyness.

17 Nov 2017, 18:21

Sorry, turns out it was my own sillyness. Didn't need any special code. The function I was calling was waiting for the control, shift, and alt keys to come up. Ooops!

The default behaviour of:
^!Up::

Seems to work just fine.

RunPenguinoCommand( command )
{
; Wait for keys to be up - may want to add windows key here
; Was hitting issue with command prompt commands, Ctrl was still held down when Penguin tried to hit Escape
; This made bad things happen!
; Ideally might want to wait for ALL keys to be up
KeyWait Control
KeyWait Alt
KeyWait Shift
ComObjCreate("DragonFns.Functions").SendMessageToKeyLogger(command)
}

#If WinActive("ahk_exe devenv.exe" )
^!Down::RunPenguinoCommandImmediate("devenvCommands.nextfoo")
^!Up::RunPenguinoCommandImmediate("devenvCommands.previousfoo")

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: just me, Rohwedder and 53 guests