Skip to content

Commit

Permalink
Add Meh/Hyper modifier and key support
Browse files Browse the repository at this point in the history
  • Loading branch information
magicDGS committed Feb 2, 2025
1 parent ff585d1 commit feb587f
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 14 deletions.
42 changes: 28 additions & 14 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,24 +61,38 @@ Nevertheless, some behaviors are not available on all OS, and will be marked in

The core definitions are provided by default by the intial setup (including the `init.h` header on the `.keymap` file), which can be used with `&kp` or any other behavior:

| Shortcut | Description | L | W | M |
| ------------ | -------------------------- | --- | --- | --- |
| `_REDO` | Redo shortcut | ⭐ | ⭐ | ⭐ |
| `_UNDO` | Undo shortcut | ⭐ | ⭐ | ⭐ |
| `_COPY` | Copy shortcut | ⭐ | ⭐ | ⭐ |
| `_PASTE` | Paste shortcut | ⭐ | ⭐ | ⭐ |
| `_FIND` | Find shortcut | ⭐ | ⭐ | ⭐ |
| `_FIND_NEXT` | Find next shortcut | ⭐ | ⭐ | ⭐ |
| `_FIND_PREV` | Find previous shortcut | ⭐ | ⭐ | ⭐ |
| `_HOME` | Home key (shortcut in mac) | ⭐ | ⭐ | ⭐ |
| `_END` | End key (shortcut in mac) | ⭐ | ⭐ | ⭐ |
| `_POWER` | Power shortcut | ⭐ | ❌ | ⭐ |
| `_SLEEP` | Sleep shortcut | ⭐ | ❌ | ⭐ |
| `_LOCK` | Lock shortcut | ⭐ | ⭐ | ⭐ |
| Shortcut | Description | L | W | M |
| ------------ | ------------------------------ | --- | --- | --- |
| `_REDO` | Redo shortcut | ⭐ | ⭐ | ⭐ |
| `_UNDO` | Undo shortcut | ⭐ | ⭐ | ⭐ |
| `_COPY` | Copy shortcut | ⭐ | ⭐ | ⭐ |
| `_PASTE` | Paste shortcut | ⭐ | ⭐ | ⭐ |
| `_FIND` | Find shortcut | ⭐ | ⭐ | ⭐ |
| `_FIND_NEXT` | Find next shortcut | ⭐ | ⭐ | ⭐ |
| `_FIND_PREV` | Find previous shortcut | ⭐ | ⭐ | ⭐ |
| `_HOME` | Home key (shortcut in mac) | ⭐ | ⭐ | ⭐ |
| `_END` | End key (shortcut in mac) | ⭐ | ⭐ | ⭐ |
| `_POWER` | Power shortcut | ⭐ | ❌ | ⭐ |
| `_SLEEP` | Sleep shortcut | ⭐ | ❌ | ⭐ |
| `_LOCK` | Lock shortcut | ⭐ | ⭐ | ⭐ |
| `_MEH` | Meh key (Shift+Ctrl+Alt) | ⭐ | ⭐ | ⭐ |
| `_HYPER` | Hyper key (Shift+Ctrl+Alt+Gui) | ⭐ | ⭐ | ⭐ |

> [!CAUTION]
> The shortcuts might not work as expected if the `&caps_word` behavior is active.

Also some modifier function smight be provided:

| Modifier | Description |
| --------- | ------------------------------------------------------ |
| `_C(key)` | OS-specific modifier for shortcuts (Cntrl/Command+key) |
| `_M(key)` | Meh modifier (Meh+key) |
| `_H(key)` | Hyper modifier (Hyper+key) |

> [!IMPORTANT]
> The Meh/Hyper related functionality might be available eventually in the zmk project keys.h/modifiers.h defaults (see [PR#2341](https://github.com/zmkfirmware/zmk/pull/2341)).
> Future versions of this module would most likely remove these aliases to encourage its use.

Other definitons might be used on different behaviors and are not intended to be consumed by the user.

## Select Word
Expand Down
7 changes: 7 additions & 0 deletions include/zmk-keymap-utils/init.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,13 @@
#define _FIND_NEXT _C(G)
#define _FIND_PREV _C(LS(G))

// meh/hyper as keys and modifiers
// TODO: this might not be necessary after https://github.com/zmkfirmware/zmk/pull/2341
#define _MEH LS(LC(LALT))
#define _M(key) LS(LC(LA(key)))
#define _HYPER LS(LC(LA(LGUI)))
#define _H(key) LS(LC(LA(LG(key)))

/* Include helpers here
NOTE: all usages of ZMK_ functions are overriden from this point on,
so only include modules/functions working with them
Expand Down

0 comments on commit feb587f

Please sign in to comment.