qmk-firmware/keyboards/hub16/keymaps/ahk_companion
Nick Blyumberg b58f9ef1e2
[Keymap] Hub16 AutoHotKey Companion (#10159)
* Hub16 AutoHotKey Companion

* Revised after PR comments by Drashna

* Update keyboards/hub16/keymaps/ahk_companion/readme.md

Co-authored-by: James Young <18669334+noroadsleft@users.noreply.github.com>

* Update keyboards/hub16/keymaps/ahk_companion/readme.md

Co-authored-by: James Young <18669334+noroadsleft@users.noreply.github.com>

* Update keyboards/hub16/keymaps/ahk_companion/readme.md

Co-authored-by: James Young <18669334+noroadsleft@users.noreply.github.com>

* Update keyboards/hub16/keymaps/ahk_companion/readme.md

Co-authored-by: James Young <18669334+noroadsleft@users.noreply.github.com>

* Update keyboards/hub16/keymaps/ahk_companion/readme.md

Co-authored-by: James Young <18669334+noroadsleft@users.noreply.github.com>

* Update keyboards/hub16/keymaps/ahk_companion/keymap.c

Co-authored-by: Drashna Jaelre <drashna@live.com>

Co-authored-by: James Young <18669334+noroadsleft@users.noreply.github.com>
Co-authored-by: Drashna Jaelre <drashna@live.com>
2020-09-14 18:15:25 -07:00
..
ahk_companion.ahk
config.h
keymap.c
readme.md
rules.mk

AutoHotKey Companion

Overview

AutoHotKey Companion Keymap for Hub16 macropad is designed be a quick and easy way to get started with AutoHotKey and to provide a foundation for customizing your own macropad. I upgraded to the Super16 from a Super16 because it kept the RGB underglow lights for an easy way (RGB) to identify what layer I was on with a quick glance or peripheral vision and added 2 rotary encoders and a USB 2.0 hub with USB-C ports. The F13 to F24 keys were selected as they are rarely used so you won't run into conflicts with existing application shortcuts and AutoHotKey recognizes them without any issues. Note: MacOS does not support/recognize F21 to F24 so these would need to be remapped for Mac users.

Same functionality can be accomplished with other similar applications on the host system like Keyboard Maestro, AutoIt, etc.

This keymap allows for a total of 48 Function/Macro keys that are accessible within 2 sequential key presses (or more when extended with your own code and additional layers)

Encoders

Encoder functionality was made based on my needs but it can be remapped as desired by changing the keycodes.

Left Encoder:

  • Counter clockwise: Previous Multimedia
  • Clockwise: Next Multimedia
  • Click: Play/Pause

Right Encoder:

  • Counter clockwise: Volume Down
  • Clockwise: Volume Up
  • Click: Mute/Unmute

Alternate Implementations

I chose to use QMK OSL (One Shot Layer) functionality to avoid having to hold a key while selecting the next key and to have my layers always go back to the default layer as the starting point. This also helps me avoid having to cognitively remember what layer I am on.

If persistent behavior is prefered, OSL can be swapped for TG which will toggle the layer on/off with a key press instead of clearing the layer once the Function key is pressed. This is useful if a layer contains several keys that need to be used in sequence. I also added a OSL timeout of 3 seconds, so that if the key is not pressed within 3 seconds the layer will go back to default. This can be adjusted in the config.h file by increasing 3000 to a desired value: #define ONESHOT_TIMEOUT 3000

Layers

While the first 5 layers are accessible with only 1 key press at most, the 5th (less frequently used) layer is accessed by first going to the 4th layer, which makes the TG(5) button available on the bottom left. Space for additional 2 more layer toggles is available on the 2 middle buttons on the bottom row. Please refer to the layer diagrams.

  • Layer 0 (Base Layer) - the default layer and functions like sending the F13 to F24 keys along with the bottom row to activate another 4 layers.

    Image of Base Layer

  • Layer 1 (Alt Layer) - Equivalent to Alt+Fxx key being pressed

    Image of Layer 1

  • Layer 2 (Shift Layer) - Equivalent to Shift+Fxx key being pressed

    Image of Layer 2

  • Layer 3 (Control Layer) - Equivalent to Ctrl+Fxx key being pressed

    Image of Layer 3

  • Layer 4 (Config Layer) - Layer for multimedia. You can replace the KC_TRNS on this layer in keymap.c to TG(x) to enable additional layers.

    Image of Layer 4

  • Layer 5 (RGB Control/QMK) - RGB control layer and Quantum functions (Reset, EEPROM Reset, )

    Image of Layer 5

Host Configuration

Once the keymap has been flashed to the Super16, you can download the accompanying AutoHotKey file or create your own and have it start automatically either via a Windows Task or another way. Using AutoHotKey allows adjustment of functionality of the buttons without the need to change your map and reflash the macropad every time. Starting the AHK file can be done either by:

  • Creating a Windows Task
  • Adding the AHK to the startup folder
  • Launch manually