From 443467c8b1d5fe916c4ec96eaa94f652347190ab Mon Sep 17 00:00:00 2001 From: Laurent Bardin Date: Sun, 9 Mar 2025 13:00:02 +0100 Subject: [PATCH] Add support for Mission Control and Launchpad keycodes This commit only adds support in the "Configure" section, so they still won't be recognized by the "Macros" section. To do so would require amending the auto-complete-able keycodes, but I'm not sure there's any incentive to do so given what these two functions do. --- src/utils/key-to-byte/default.ts | 2 ++ src/utils/key-to-byte/v10.ts | 2 ++ src/utils/key-to-byte/v11.ts | 2 ++ src/utils/key-to-byte/v12.ts | 2 ++ src/utils/key.ts | 12 ++++++++++++ 5 files changed, 20 insertions(+) diff --git a/src/utils/key-to-byte/default.ts b/src/utils/key-to-byte/default.ts index 65493d08..b77d8d6d 100644 --- a/src/utils/key-to-byte/default.ts +++ b/src/utils/key-to-byte/default.ts @@ -214,6 +214,8 @@ export default { KC_MRWD: 0x00bc, KC_BRIU: 0x00bd, KC_BRID: 0x00be, + KC_MCTL: 0x00c1, + KC_LPAD: 0x00c2, KC_LCTL: 0x00e0, KC_LSFT: 0x00e1, KC_LALT: 0x00e2, diff --git a/src/utils/key-to-byte/v10.ts b/src/utils/key-to-byte/v10.ts index bea80db3..41957710 100644 --- a/src/utils/key-to-byte/v10.ts +++ b/src/utils/key-to-byte/v10.ts @@ -214,6 +214,8 @@ export default { KC_MRWD: 0x00bc, KC_BRIU: 0x00bd, KC_BRID: 0x00be, + KC_MCTL: 0x00c1, + KC_LPAD: 0x00c2, KC_LCTL: 0x00e0, KC_LSFT: 0x00e1, KC_LALT: 0x00e2, diff --git a/src/utils/key-to-byte/v11.ts b/src/utils/key-to-byte/v11.ts index 23a68e91..3586c226 100644 --- a/src/utils/key-to-byte/v11.ts +++ b/src/utils/key-to-byte/v11.ts @@ -214,6 +214,8 @@ export default { KC_MRWD: 0x00bc, KC_BRIU: 0x00bd, KC_BRID: 0x00be, + KC_MCTL: 0x00c1, + KC_LPAD: 0x00c2, KC_MS_UP: 0x00cd, KC_MS_DOWN: 0x00ce, KC_MS_LEFT: 0x00cf, diff --git a/src/utils/key-to-byte/v12.ts b/src/utils/key-to-byte/v12.ts index 0f251280..939d5c35 100644 --- a/src/utils/key-to-byte/v12.ts +++ b/src/utils/key-to-byte/v12.ts @@ -214,6 +214,8 @@ export default { KC_MRWD: 0x00bc, KC_BRIU: 0x00bd, KC_BRID: 0x00be, + KC_MCTL: 0x00c1, + KC_LPAD: 0x00c2, KC_MS_UP: 0x00cd, KC_MS_DOWN: 0x00ce, KC_MS_LEFT: 0x00cf, diff --git a/src/utils/key.ts b/src/utils/key.ts index 243c0710..cb53668f 100644 --- a/src/utils/key.ts +++ b/src/utils/key.ts @@ -877,6 +877,18 @@ export function getKeycodes(numMacros = 16): IKeycodeMenu[] { shortName: 'Scr -', title: 'Screen Brightness Down', }, + { + name: 'Mission Control', + code: 'KC_MCTL', + shortName: 'Mctl', + title: 'Open Mission Control (macOS)', + }, + { + name: 'Launchpad', + code: 'KC_LPAD', + shortName: 'Lpad', + title: 'Open Launchpad (macOS)', + }, {name: 'F13', code: 'KC_F13'}, {name: 'F14', code: 'KC_F14'}, {name: 'F15', code: 'KC_F15'},