Jump to content


multiple hotkeys for same action?


  • Please log in to reply
3 replies to this topic

#1 gibbard

gibbard
  • Guests

Posted 31 May 2012 - 04:47 PM

Hi everyone! I'm trying to figure out if it's possible to have two hotkeys for the same action. For example, popup a msgbox if either #1 or Joy3 is hit. The below example does NOT function, but I'm hoping there is a similar method I'm missing in the documentation. I'm trying to avoid copying the same action twice in my script, once for each hotkey...

#1 OR Joy3::
msgbox, One of the hotkeys was pressed!!!
return

Thanks!

#2 Pulover

Pulover
  • Members
  • 1292 posts

Posted 31 May 2012 - 05:01 PM

There is. It's in the Hotkeys documentation.

Multiple hotkeys can be stacked vertically to have them perform the same action. For example:

^Numpad0::
^Numpad1::
MsgBox Pressing either Control+Numpad0 or Control+Numpad1 will display this message.
return



#3 Guests

  • Guests

Posted 31 May 2012 - 05:09 PM

Very similar question regarding hotstrings <!-- l --><a class="postlink-local" href="http://www.autohotkey.com/community/viewtopic.php?f=1&t=87028">viewtopic.php?f=1&t=87028</a><!-- l -->

#4 gibbard

gibbard
  • Guests

Posted 31 May 2012 - 06:04 PM

AHA! I knew it must be somewhere! I apologize for missing that. I guess I wasn't using the right terms in my searches...