Saturday, 2025-01-18, 9:51 AM
Welcome Guest

Blog

Main » 2011 » March » 27 » Create a Simple DotA HotKey
4:43 PM
Create a Simple DotA HotKey
I assume that you already read my first tutorial on how to create a simple hotkey. In this tutorial, we will be going to create a simple DotA Hotkey.

On the previous tutorial, we created a simple hotkey, and today we will going to make a simple DotA Hotkey.

We will use the same syntax, see below, to create the hotkey. Lets say for example the item slot 1 or the item on Numpad7, the upper-left item, the commonly used hotkey is Alt+Q so that's is what we are going to use.

And this is the syntax that we are going to use:

Code
YourHotkey:: Send, [ Keys

YourHotkey = your desired hotkey (!Q or Alt+Q in this example)
Key = the key to press or mouse click

Here is the sample code for sending Numpad7 using Alt+Q.

Code
!Q:: Send, {Numpad7}

For keys like Numpad#, Enter, Space, Shift, etc., the keys should be enclosed by open and close braces or even with the mouse clicks.

Making a Context-Sensitive Hotkey:
You know that the hotkey is not context-sensitive which means that you can use the hotkey anywhere aside Warcraft III. So we will be going to address that. Put this code on the top of your project.

Code
#IfWinActive ahk_class Warcraft III

The code above means that the hotkey will only be effective if the Warcraft III window is active, or simply you are inside Warcraft III.

Full Sample Code:

Code
#IfWinActive ahk_class Warcraft III

!Q:: Send, {Numpad7}
!W:: Send, {Numpad8}
!A:: Send, {Numpad4}
!S:: Send, {Numpad5}
!Z:: Send, {Numpad1}
!X:: Send, {Numpad2}
Views: 8204 | Added by: GarenaZero | Rating: 5.0/1
Total comments: 0
Name *:
Email *:
Code *: