Add modifiers MEH and Hyper as well as a COPILOT key.

This commit is contained in:
Hans Kruse 2024-07-13 10:02:11 +02:00
parent 8c6bda260a
commit 73091bb037
5 changed files with 162 additions and 1 deletions

View file

@ -1443,3 +1443,6 @@
/* Apple Globe key */
#define C_AC_NEXT_KEYBOARD_LAYOUT_SELECT (ZMK_HID_USAGE(HID_USAGE_CONSUMER, 0x029D))
#define GLOBE (C_AC_NEXT_KEYBOARD_LAYOUT_SELECT)
/* Microsoft Copilot key */
#define COPILOT LS(LG(F23))

View file

@ -25,4 +25,21 @@
#define RC(keycode) APPLY_MODS(MOD_RCTL, keycode)
#define RS(keycode) APPLY_MODS(MOD_RSFT, keycode)
#define RA(keycode) APPLY_MODS(MOD_RALT, keycode)
#define RG(keycode) APPLY_MODS(MOD_RGUI, keycode)
#define RG(keycode) APPLY_MODS(MOD_RGUI, keycode)
#define LEFT_HYPER LS(LC(LA(LGUI)))
#define LH(key) LS(LC(LA(LG(key))))
#define LHYPER LEFT_HYPER
#define OFFICE LEFT_HYPER
#define LEFT_MEH LS(LC(LALT))
#define LM(key) LS(LC(LA(key)))
#define LMEH LEFT_MEH
#define RIGHT_HYPER RS(RC(RA(RGUI)))
#define RH(key) RS(RC(RA(RG(key))))
#define RHYPER RIGHT_HYPER
#define RIGHT_MEH RS(RC(RALT))
#define RM(key) RS(RC(RA(key)))
#define RMEH RIGHT_MEH

View file

@ -46,3 +46,33 @@ These functions take the form: `XX(code)`
- `LS(x)`, `LC(x)`, `LA(x)`, `LG(x)`, `RS(x)`, `RC(x)`, `RA(x)`, `RG(x)`
- Modified keys can safely be rolled-over. Modifier functions are released when another key is pressed.
- Press `&kp LS(A)`, then press `&kp B`, release `&kp LS(A)` and release `&kp B` results in **Ab**. Only the A is capitalized.
### Extra Modifiers
Extra modifiers are combinations of the special keyboard keys: _shift_, _alt_, _control_ & _GUI_.
Extra Modifiers can be used in the following forms within ZMK:
- `LHYPER`
- `LH(code)`
<Table group="keyboard-extra-modifiers" />
The combination of all modifiers `SHIFT`, `GUI`, `ALT` and `CONTROL` is colloquially known as `HYPER`.
Similarly, the combination of `SHIFT`, `ALT` and `CONTROL` (without `GUI`) is referred to as `MEH`.
### Extra Modifier Keys
These act like any other key code.
- e.g. `&kp LHYPER` pushes and releases the combination of the left modifiers SHIFT, GUI, ALT and CONTROL.
### Extra Modifier Functions
Modifier functions add one or more modifiers to a code.
These functions take the form: `XX(code)`
- Modifier functions apply a modifier to a code:
- `&kp LH(W)` = `LEFT SHIFT` + `LEFT GUI` + `LEFT CONTROL` + `LEFT ALT` + `W`; in recent versions of Windows, this will open Microsoft Word.
- There are left- and right-handed versions of each extra modifier (also see table above).

View file

@ -276,6 +276,12 @@ export default {
"LEFT_GUI",
"RIGHT_GUI",
],
"keyboard-extra-modifiers": [
"LEFT_MEH",
"RIGHT_MEH",
"LEFT_HYPER",
"RIGHT_HYPER",
],
"keyboard-navigation": [
"HOME",
"END",

View file

@ -4251,6 +4251,90 @@ export default [
},
footnotes: {},
},
{
names: ["LEFT_HYPER", "LHYPER", "OFFICE", "LH(code)"],
description: "Left Hyper: Left SHIFT, GUI, ALT, CONTROL",
context: "Keyboard",
clarify: false,
usages: [
{
application: keyboardApplication,
item: usage(keyPage, 0xe1),
},
],
documentation: "",
os: {
windows: true,
linux: true,
android: true,
macos: true,
ios: true,
},
footnotes: {},
},
{
names: ["RIGHT_HYPER", "RHYPER", "RH(code)"],
description: "Right HYPER: Right SHIFT, GUI, ALT, CONTROL",
context: "Keyboard",
clarify: false,
usages: [
{
application: keyboardApplication,
item: usage(keyPage, 0xe1),
},
],
documentation: "",
os: {
windows: true,
linux: true,
android: true,
macos: true,
ios: true,
},
footnotes: {},
},
{
names: ["LEFT_MEH", "LM(code)"],
description: "Left MEH: Left SHIFT, ALT, CONTROL",
context: "Keyboard",
clarify: false,
usages: [
{
application: keyboardApplication,
item: usage(keyPage, 0xe1),
},
],
documentation: "",
os: {
windows: true,
linux: true,
android: true,
macos: true,
ios: true,
},
footnotes: {},
},
{
names: ["RIGHT_MEH", "RM(code)"],
description: "Right MEH: Right SHIFT, ALT, CONTROL",
context: "Keyboard",
clarify: false,
usages: [
{
application: keyboardApplication,
item: usage(keyPage, 0xe1),
},
],
documentation: "",
os: {
windows: true,
linux: true,
android: true,
macos: true,
ios: true,
},
footnotes: {},
},
{
names: ["K_PLAY_PAUSE", "K_PP"],
description: "Play / Pause",
@ -7888,4 +7972,25 @@ export default [
macos: ["globe"],
},
},
{
names: ["COPILOT"],
description: "Microsoft Copilot shortcut LS(LG(F23))",
context: "Keyboard",
clarify: false,
usages: [
{
application: keyboardApplication,
item: usage(keyPage, 0x72),
},
],
documentation: "https://usb.org/sites/default/files/hut1_2.pdf#page=86",
os: {
windows: true,
linux: null,
android: null,
macos: null,
ios: null,
},
footnotes: {},
},
];