UHK Gaming Ideas: Macros and Keymaps


The UHK has all the time been helpful for gaming, however as we hold enhancing it with new options, it’s turning into a formidable weapon within the palms of avid gamers.

As an off-the-cuff gamer, I need to share a few of the issues I’ve been doing with my UHK to enhance my gaming expertise.

Double-Faucet Weapon Choice

Each every now and then, I slay demons in Doom Everlasting, and I’ve all the time discovered it difficult to select the precise weapon I need to use. My left hand is all the time on the WASD cluster, and my proper hand is all the time on the mouse.

UHK Gaming Ideas: Macros and Keymaps 1

The numbers 1 to eight, highlighted in crimson, are mapped to weapons. Even when utilizing the UHK in merged mode (the 2 halves linked collectively), the gap between the WASD cluster and eight is way too massive, so it is sensible to map all of the weapons to numbers 1 to 4.

Let’s go away 1 to 4 unmodified when single-tapped, however when double-tapped, let’s make these keys emit 5 to eight. To implement this for key 1, I exploit the next good macro:

UHK Gaming Ideas: Macros and Keymaps 2
ifDoubletap last tapKey 5  // double-tap: tremendous shotgun
tapKey 1  // single-tap: fight shotgun

(To create a sensible macro in Agent, you need to create a macro, click on on the “Add macro motion” button, and choose “Command”.)

Parameterized Macros

The above macro works nice, and I may copy-paste it and modify the numbers for the opposite keys, however there’s a greater approach by utilizing parameterized macros:

UHK Gaming Ideas: Macros and Keymaps 3
ifDoubletap last tapKey &macroArg.2  // double-tap
tapKey &macroArg.1  // single-tap

Now we are able to reuse this macro for the opposite quantity keys by merely altering the arguments.

Lazy Double-Faucet

Our macro is great for first-person shooters as a result of as quickly as you hit the important thing, the weapon is instantly chosen, and whenever you hit the important thing once more, the opposite weapon is chosen.

However this habits is undesirable in MOBAs and MMORPGs, the place you usually need to select between two associated actions with out unintentionally triggering the primary one. For instance:

  • Single-tap: Forged a therapeutic spell in your focused ally
  • Double-tap: Self-cast the identical therapeutic spell

For such a habits, we are able to use the next macro:

ifGesture timeoutIn 200 $thisKeyId last tapKey &macroArg.2  // double-tap
tapKey &macroArg.1  // single-tap

This macro won’t emit the single-tap character when double-tapping the important thing, solely when the timeout has elapsed.

Keymap Inheritance

When creating a brand new keymap, it’s tempting to start out along with your default keymap, such because the “QWERTY for PC” keymap, and override the specified keys. However this manner, you gained’t be capable to simply inform which keys had been overridden in your new keymap.

Even worse, when having to alter the default keymap, you’ll must override all of the keymaps by which you relied on the default keymap. There’s a greater approach: keymap inheritance.

As a substitute of beginning with a default keymap, begin with an empty keymap and inherit from a base keymap. This manner, you may override the specified keys in your new keymap and go away the remaining clean.

Let’s say your base keymap is the “QWERTY for PC keymap”, which has the “QWR” abbreviation.

UHK Gaming Ideas: Macros and Keymaps 4

Now, create a clean keymap and let’s identify it “Doom Everlasting” with the “DOE” abbreviation. To inherit from the “QWERTY for PC” keymap, create the next good macro in Agent:

UHK Gaming Ideas: Macros and Keymaps 5
replaceKeymap QWR
overlayKeymap present

This good macro has a particular identify of $onKeymapChange DOE, making it a macro occasion that’s robotically executed when switching to the Doom Everlasting keymap.

  • The replaceKeymap QWR command replaces the present keymap with the “QWERTY for PC” keymap.
  • Then the overlayKeymap present command overlays the nonempty keys of the “Doom Everlasting” keymap on prime of the “QWERTY for PC” keymap.

You may go loopy and create multilevel inheritance this manner, equivalent to utilizing a base keymap, making a descendant Gaming keymap, after which making a descendant “Doom Everlasting” keymap on prime of the Gaming keymap.

If you wish to delve into the world of good macros, try its person information and reference handbook.

That’s It for Now

I hope this text has given you some concepts on learn how to use your UHK to enhance your gaming expertise or simply manage your keymaps higher.

We’re excited to share extra concerning the energy of macro-related options in future articles, as there’s a lot extra you are able to do with them.

Speak to you quickly!

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest Articles