Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move KC_MISSION_CONTROL/KC_LAUNCHPAD keycodes to core #19884

Merged
merged 3 commits into from
Feb 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions data/constants/keycodes/keycodes_0.0.2_basic.hjson
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"keycodes": {
"0x00C1": {
"group": "media",
"key": "KC_MISSION_CONTROL",
"label": "Open Mission Control",
"aliases": [
"KC_MCTL"
]
},
"0x00C2": {
"group": "media",
"key": "KC_LAUNCHPAD",
"label": "Open Launchpad",
"aliases": [
"KC_LPAD"
]
}
}
}
2 changes: 2 additions & 0 deletions docs/keycodes.md
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,8 @@ See also: [Basic Keycodes](keycodes_basic.md)
|`KC_BRIGHTNESS_DOWN` |`KC_BRID` |Brightness Down |✔ |✔ |✔ |
|`KC_CONTROL_PANEL` |`KC_CPNL` |Open Control Panel |✔ | | |
|`KC_ASSISTANT` |`KC_ASST` |Launch Context-Aware Assistant |✔ | | |
|`KC_MISSION_CONTROL` |`KC_MCTL` |Open Mission Control | |✔ | |
|`KC_LAUNCHPAD` |`KC_LPAD` |Open Launchpad | |✔ | |

<sup>1. The Linux kernel HID driver recognizes [nearly all keycodes](https://github.com/torvalds/linux/blob/master/drivers/hid/hid-input.c), but the default bindings depend on the DE/WM.</sup><br/>
<sup>2. Treated as F13-F15.</sup><br/>
Expand Down
62 changes: 32 additions & 30 deletions docs/keycodes_basic.md
Original file line number Diff line number Diff line change
Expand Up @@ -193,36 +193,38 @@ These keycodes are not part of the Keyboard/Keypad usage page. The `SYSTEM_` key

?> Some of these keycodes may behave differently depending on the OS. For example, on macOS, the keycodes `KC_MEDIA_FAST_FORWARD`, `KC_MEDIA_REWIND`, `KC_MEDIA_NEXT_TRACK` and `KC_MEDIA_PREV_TRACK` skip within the current track when held, but skip the entire track when tapped.

|Key |Aliases |Description |
|-----------------------|---------|-------------------|
|`KC_SYSTEM_POWER` |`KC_PWR` |System Power Down |
|`KC_SYSTEM_SLEEP` |`KC_SLEP`|System Sleep |
|`KC_SYSTEM_WAKE` |`KC_WAKE`|System Wake |
|`KC_AUDIO_MUTE` |`KC_MUTE`|Mute |
|`KC_AUDIO_VOL_UP` |`KC_VOLU`|Volume Up |
|`KC_AUDIO_VOL_DOWN` |`KC_VOLD`|Volume Down |
|`KC_MEDIA_NEXT_TRACK` |`KC_MNXT`|Next Track |
|`KC_MEDIA_PREV_TRACK` |`KC_MPRV`|Previous Track |
|`KC_MEDIA_STOP` |`KC_MSTP`|Stop Track |
|`KC_MEDIA_PLAY_PAUSE` |`KC_MPLY`|Play/Pause Track |
|`KC_MEDIA_SELECT` |`KC_MSEL`|Launch Media Player|
|`KC_MEDIA_EJECT` |`KC_EJCT`|Eject |
|`KC_MAIL` | |Launch Mail |
|`KC_CALCULATOR` |`KC_CALC`|Launch Calculator |
|`KC_MY_COMPUTER` |`KC_MYCM`|Launch My Computer |
|`KC_WWW_SEARCH` |`KC_WSCH`|Browser Search |
|`KC_WWW_HOME` |`KC_WHOM`|Browser Home |
|`KC_WWW_BACK` |`KC_WBAK`|Browser Back |
|`KC_WWW_FORWARD` |`KC_WFWD`|Browser Forward |
|`KC_WWW_STOP` |`KC_WSTP`|Browser Stop |
|`KC_WWW_REFRESH` |`KC_WREF`|Browser Refresh |
|`KC_WWW_FAVORITES` |`KC_WFAV`|Browser Favorites |
|`KC_MEDIA_FAST_FORWARD`|`KC_MFFD`|Next Track |
|`KC_MEDIA_REWIND` |`KC_MRWD`|Previous Track |
|`KC_BRIGHTNESS_UP` |`KC_BRIU`|Brightness Up |
|`KC_BRIGHTNESS_DOWN` |`KC_BRID`|Brightness Down |
|`KC_CONTROL_PANEL` |`KC_CPNL`|Open Control Panel |
|`KC_ASSISTANT` |`KC_ASST`|Launch Assistant |
|Key |Aliases |Description |
|-----------------------|---------|--------------------|
|`KC_SYSTEM_POWER` |`KC_PWR` |System Power Down |
|`KC_SYSTEM_SLEEP` |`KC_SLEP`|System Sleep |
|`KC_SYSTEM_WAKE` |`KC_WAKE`|System Wake |
|`KC_AUDIO_MUTE` |`KC_MUTE`|Mute |
|`KC_AUDIO_VOL_UP` |`KC_VOLU`|Volume Up |
|`KC_AUDIO_VOL_DOWN` |`KC_VOLD`|Volume Down |
|`KC_MEDIA_NEXT_TRACK` |`KC_MNXT`|Next Track |
|`KC_MEDIA_PREV_TRACK` |`KC_MPRV`|Previous Track |
|`KC_MEDIA_STOP` |`KC_MSTP`|Stop Track |
|`KC_MEDIA_PLAY_PAUSE` |`KC_MPLY`|Play/Pause Track |
|`KC_MEDIA_SELECT` |`KC_MSEL`|Launch Media Player |
|`KC_MEDIA_EJECT` |`KC_EJCT`|Eject |
|`KC_MAIL` | |Launch Mail |
|`KC_CALCULATOR` |`KC_CALC`|Launch Calculator |
|`KC_MY_COMPUTER` |`KC_MYCM`|Launch My Computer |
|`KC_WWW_SEARCH` |`KC_WSCH`|Browser Search |
|`KC_WWW_HOME` |`KC_WHOM`|Browser Home |
|`KC_WWW_BACK` |`KC_WBAK`|Browser Back |
|`KC_WWW_FORWARD` |`KC_WFWD`|Browser Forward |
|`KC_WWW_STOP` |`KC_WSTP`|Browser Stop |
|`KC_WWW_REFRESH` |`KC_WREF`|Browser Refresh |
|`KC_WWW_FAVORITES` |`KC_WFAV`|Browser Favorites |
|`KC_MEDIA_FAST_FORWARD`|`KC_MFFD`|Next Track |
|`KC_MEDIA_REWIND` |`KC_MRWD`|Previous Track |
|`KC_BRIGHTNESS_UP` |`KC_BRIU`|Brightness Up |
|`KC_BRIGHTNESS_DOWN` |`KC_BRID`|Brightness Down |
|`KC_CONTROL_PANEL` |`KC_CPNL`|Open Control Panel |
|`KC_ASSISTANT` |`KC_ASST`|Launch Assistant |
|`KC_MISSION_CONTROL` |`KC_MCTL`|Open Mission Control|
|`KC_LAUNCHPAD` |`KC_LPAD`|Open Launchpad |

## Number Pad

Expand Down
21 changes: 0 additions & 21 deletions keyboards/gmmk/pro/rev1/ansi/keymaps/andrebrait/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,8 @@ enum layers {
MAC_FN
};

enum custom_keycodes {
KC_MISSION_CONTROL = SAFE_RANGE,
KC_LAUNCHPAD
};

#define KC_TASK LGUI(KC_TAB)
#define KC_FLXP LGUI(KC_E)
#define KC_MCTL KC_MISSION_CONTROL
#define KC_LPAD KC_LAUNCHPAD
#define TO_WINB TO(WIN_BASE)
#define TO_MACB TO(MAC_BASE)
#define MO_WINF MO(WIN_FN)
Expand Down Expand Up @@ -174,20 +167,6 @@ bool led_update_user(led_t led_state) {

bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case KC_MISSION_CONTROL:
if (record->event.pressed) {
host_consumer_send(0x29F);
} else {
host_consumer_send(0);
}
return false; // Skip all further processing of this key
case KC_LAUNCHPAD:
if (record->event.pressed) {
host_consumer_send(0x2A0);
} else {
host_consumer_send(0);
}
return false; // Skip all further processing of this key
#ifdef RGB_MATRIX_ENABLE
#ifdef NKRO_ENABLE
case NK_TOGG:
Expand Down
21 changes: 1 addition & 20 deletions keyboards/gmmk/pro/rev1/ansi/keymaps/macos/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include QMK_KEYBOARD_H

enum my_keycodes {
KC_MSCTRL = SAFE_RANGE,
KC_LNPD,
LED_TLDE,
LED_TLDE = SAFE_RANGE,
LED_1,
LED_2,
LED_3,
Expand Down Expand Up @@ -209,23 +207,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {

bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
// https://github.com/qmk/qmk_firmware/issues/10111
case KC_MSCTRL:
if (record->event.pressed) {
host_consumer_send(0x29F);
} else {
host_consumer_send(0);
}
return false; /* Skip all further processing of this key */

case KC_LNPD:
if (record->event.pressed) {
host_consumer_send(0x2A0);
} else {
host_consumer_send(0);
}
return false; /* Skip all further processing of this key */

#ifdef NKRO_ENABLE
#if RGB_CONFIRMATION_BLINKING_TIME > 0
case NK_TOGG:
Expand Down
33 changes: 0 additions & 33 deletions keyboards/keebio/sinc/keymaps/lickel/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,6 @@

#include QMK_KEYBOARD_H

enum custom_keycodes {
#ifdef VIA_ENABLE
KC_MISSION_CONTROL = USER00,
#else
KC_MISSION_CONTROL = SAFE_RANGE,
#endif
KC_LAUNCHPAD
};

#define KC_MCTL KC_MISSION_CONTROL
#define KC_LPAD KC_LAUNCHPAD

// clang-format off

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
Expand Down Expand Up @@ -75,24 +63,3 @@ const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = {
[3] = { ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(_______, _______) },
};
#endif

bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case KC_MISSION_CONTROL:
if (record->event.pressed) {
host_consumer_send(0x29F);
} else {
host_consumer_send(0);
}
return false;
case KC_LAUNCHPAD:
if (record->event.pressed) {
host_consumer_send(0x2A0);
} else {
host_consumer_send(0);
}
return false;
default:
return true;
}
}
14 changes: 0 additions & 14 deletions keyboards/keychron/common/keychron_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,20 +41,6 @@ void housekeeping_task_keychron(void) {

bool process_record_keychron(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case KC_MISSION_CONTROL:
if (record->event.pressed) {
host_consumer_send(0x29F);
} else {
host_consumer_send(0);
}
return false; // Skip all further processing of this key
case KC_LAUNCHPAD:
if (record->event.pressed) {
host_consumer_send(0x2A0);
} else {
host_consumer_send(0);
}
return false; // Skip all further processing of this key
case KC_LOPTN:
case KC_ROPTN:
case KC_LCMMD:
Expand Down
8 changes: 2 additions & 6 deletions keyboards/keychron/common/keychron_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,10 @@

enum custom_keycodes {
#ifdef VIA_ENABLE
KC_MISSION_CONTROL = USER00,
KC_LOPTN = USER00,
#else
KC_MISSION_CONTROL = SAFE_RANGE,
KC_LOPTN = SAFE_RANGE,
#endif
KC_LAUNCHPAD,
KC_LOPTN,
KC_ROPTN,
KC_LCMMD,
KC_RCMMD,
Expand All @@ -38,8 +36,6 @@ enum custom_keycodes {
KC_CORTANA
};

#define KC_MCTL KC_MISSION_CONTROL
#define KC_LPAD KC_LAUNCHPAD
#define KC_TASK KC_TASK_VIEW
#define KC_FLXP KC_FILE_EXPLORER
#define KC_SNAP KC_SCREEN_SHOT
Expand Down
32 changes: 0 additions & 32 deletions keyboards/keychron/q1/ansi/keymaps/gtg465x/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,6 @@

// clang-format off

enum custom_keycodes {
#ifdef VIA_ENABLE
KC_MISSION_CONTROL = USER00,
#else
KC_MISSION_CONTROL = SAFE_RANGE,
#endif
KC_LAUNCHPAD
};

#define KC_MCTL KC_MISSION_CONTROL
#define KC_LPAD KC_LAUNCHPAD
#define KC_TASK LGUI(KC_TAB)
#define KC_FLXP LGUI(KC_E)

Expand Down Expand Up @@ -79,24 +68,3 @@ void matrix_init_user(void) {
rgb_matrix_init_user();
#endif
}

bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case KC_MISSION_CONTROL:
if (record->event.pressed) {
host_consumer_send(0x29F);
} else {
host_consumer_send(0);
}
return false; // Skip all further processing of this key
case KC_LAUNCHPAD:
if (record->event.pressed) {
host_consumer_send(0x2A0);
} else {
host_consumer_send(0);
}
return false; // Skip all further processing of this key
default:
return true; // Process all other keycodes normally
}
}
22 changes: 2 additions & 20 deletions keyboards/keychron/q1/ansi/keymaps/mkillewald/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,15 @@ user_config_t user_config;

enum custom_keycodes {
#ifdef VIA_ENABLE
KC_MISSION_CONTROL = USER00,
KC_LIGHT_TAB_TOGGLE = USER00,
#else
KC_MISSION_CONTROL = SAFE_RANGE,
KC_LIGHT_TAB_TOGGLE = SAFE_RANGE,
#endif
KC_LAUNCHPAD,
KC_LIGHT_TAB_TOGGLE,
KC_LIGHT_ALPHAS_TOGGLE,
KC_FN_LAYER_TRANSPARENT_KEYS_TOGGLE,
KC_FN_LAYER_COLOR_TOGGLE
};

#define KC_MCTL KC_MISSION_CONTROL
#define KC_LPAD KC_LAUNCHPAD
#define KC_LTTOG KC_LIGHT_TAB_TOGGLE
#define KC_LATOG KC_LIGHT_ALPHAS_TOGGLE
#define KC_TKTOG KC_FN_LAYER_TRANSPARENT_KEYS_TOGGLE
Expand Down Expand Up @@ -115,20 +111,6 @@ void eeconfig_init_user(void) {

bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case KC_MISSION_CONTROL:
if (record->event.pressed) {
host_consumer_send(0x29F);
} else {
host_consumer_send(0);
}
return false; // Skip all further processing of this key
case KC_LAUNCHPAD:
if (record->event.pressed) {
host_consumer_send(0x2A0);
} else {
host_consumer_send(0);
}
return false; // Skip all further processing of this key
case KC_LIGHT_TAB_TOGGLE:
if (record->event.pressed) {
user_config.caps_lock_light_tab ^= 1; // bitwise xor to toggle status bit
Expand Down
28 changes: 0 additions & 28 deletions keyboards/keychron/q1/ansi/keymaps/teimor/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,6 @@

// clang-format off

enum custom_keycodes {
KC_MISSION_CONTROL = USER00,
KC_LAUNCHPAD,
};

#define KC_MCTL KC_MISSION_CONTROL
#define KC_LPAD KC_LAUNCHPAD
#define TG_NKRO MAGIC_TOGGLE_NKRO

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
Expand Down Expand Up @@ -72,24 +65,3 @@ void matrix_init_user(void) {
rgb_matrix_init_user();
#endif
}

bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case KC_MISSION_CONTROL:
if (record->event.pressed) {
host_consumer_send(0x29F);
} else {
host_consumer_send(0);
}
return false; // Skip all further processing of this key
case KC_LAUNCHPAD:
if (record->event.pressed) {
host_consumer_send(0x2A0);
} else {
host_consumer_send(0);
}
return false; // Skip all further processing of this key
default:
return true; // Process all other keycodes normally
}
}
Loading