Input command with multiple keystrokes (ex. Shift+W)

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
daniaparecido
Posts: 3
Joined: 02 Oct 2021, 14:53

Input command with multiple keystrokes (ex. Shift+W)

Post by daniaparecido » 02 Oct 2021, 16:30

Hello! I'm making a script to show a tooltip as a menu, so that I can press another key to execute a function using Input.

But I want to be able to use a keystroke along a modifier like Shift+W to execute a function, so far I could only set single keystrokes.

I'd be really glad if someone could help me!



Here's my code:

Code: Select all

F20 & Q::
ListOfKeys = 

( 
========== SLIDE TRANSITIONS ==========
[W]  UP

[S]  DOWN

[D]  RIGHT
================================
)
Tooltip, %ListOfKeys%
Input, Key, L1 T15, {ESCAPE}

tooltip,              

if (Key = "W") { 

preset("SLIDE UP")

return,
}

if (Key = "S") { 

preset("SLIDE DOWN")

return,
}

if (Key = "D") { 

	preset("SLIDE RIGHT")

return,
}

return,

User avatar
mikeyww
Posts: 27372
Joined: 09 Sep 2014, 18:38

Re: Input command with multiple keystrokes (ex. Shift+W)

Post by mikeyww » 02 Oct 2021, 17:48

Code: Select all

F3::ToolTip,
(
========== SLIDE TRANSITIONS ==========
[W]  UP
[S]  DOWN
[D]  RIGHT
================================
)
#IfWinExist ahk_class tooltips_class32 ahk_exe AutoHotkey.exe
w::
+w::
s::
d::
ToolTip
MsgBox, 64, Done, You pressed %A_ThisHotkey%.
Return
#IfWinExist

Post Reply

Return to “Ask for Help (v1)”