Refactor more KC_MISSION_CONTROL/KC_LAUNCHPAD usages (#19891)

This commit is contained in:
Joel Challis 2023-02-20 00:59:46 +00:00 committed by GitHub
parent f71f7733a3
commit 7996be6db6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 5 additions and 149 deletions

View file

@ -26,9 +26,7 @@ enum {
}; };
enum { enum {
KC_MCON = USER00, // macOS Open Mission Control KB_ARRW = USER00, // toggle right modifiers are arrows feature
KC_LPAD, // macOS Open Launchpad
KB_ARRW, // toggle right modifiers are arrows feature
KB_RSFT, // right shift or up arrow KB_RSFT, // right shift or up arrow
KB_RALT, // right alt or left arrow KB_RALT, // right alt or left arrow
KB_RAPP, // menu or down arrow (Windows Menu) KB_RAPP, // menu or down arrow (Windows Menu)
@ -38,11 +36,6 @@ enum {
KB_VRSN // debug, type version KB_VRSN // debug, type version
}; };
enum macos_consumer_usages {
_AC_SHOW_ALL_WINDOWS = 0x29F, // mapped to KC_MCON
_AC_SHOW_ALL_APPS = 0x2A0 // mapped to KC_LPAD
};
/* Special Keys */ /* Special Keys */
#define SK_LT1C LT(_FN1, KC_CAPS) // Layer Tap 1, i.e., Tap = Caps Lock, Hold = Layer 1 #define SK_LT1C LT(_FN1, KC_CAPS) // Layer Tap 1, i.e., Tap = Caps Lock, Hold = Layer 1
#define SK_LT2A LT(_FN2, KC_APP) // Layer Tap 2, i.e., Tap = Menu, Hold = Layer 2 #define SK_LT2A LT(_FN2, KC_APP) // Layer Tap 2, i.e., Tap = Menu, Hold = Layer 2
@ -306,23 +299,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
} }
return false; return false;
// @see: https://github.com/qmk/qmk_firmware/issues/10111#issuecomment-752300353
case KC_MCON:
if (record->event.pressed) {
host_consumer_send(_AC_SHOW_ALL_WINDOWS);
} else {
host_consumer_send(0);
}
return false;
case KC_LPAD:
if (record->event.pressed) {
host_consumer_send(_AC_SHOW_ALL_APPS);
} else {
host_consumer_send(0);
}
return false;
// Shift + Backspace = Delete, see: https://docs.qmk.fm/#/feature_advanced_keycodes?id=shift-backspace-for-delete // Shift + Backspace = Delete, see: https://docs.qmk.fm/#/feature_advanced_keycodes?id=shift-backspace-for-delete
case KC_BSPC: return ID61_backspace_special(keycode, record); case KC_BSPC: return ID61_backspace_special(keycode, record);

View file

@ -31,10 +31,8 @@ enum {
}; };
enum { enum {
KC_MCON = USER00, // macOS Open Mission Control
KC_LPAD, // macOS Open Launchpad
#ifdef RGB_MATRIX_ENABLE #ifdef RGB_MATRIX_ENABLE
RGB_TPK, // Toggle Per-Key RGB_TPK = USER00, // Toggle Per-Key
#ifndef ID63_DISABLE_UNDERGLOW #ifndef ID63_DISABLE_UNDERGLOW
RGB_TUG, // Toggle Underglow RGB_TUG, // Toggle Underglow
#endif // ID63_DISABLE_UNDERGLOW #endif // ID63_DISABLE_UNDERGLOW
@ -51,11 +49,6 @@ enum {
#endif // ID63_DISABLE_UNDERGLOW #endif // ID63_DISABLE_UNDERGLOW
#endif // RGB_MATRIX_ENABLE #endif // RGB_MATRIX_ENABLE
enum macos_consumer_usages {
_AC_SHOW_ALL_WINDOWS = 0x29F, // mapped to KC_MCON
_AC_SHOW_ALL_APPS = 0x2A0 // mapped to KC_LPAD
};
/* Special Keys */ /* Special Keys */
#define SK_LT1C LT(_FN1, KC_CAPS) // Layer Tap 1, i.e., Tap = Caps Lock, Hold = Layer 1 #define SK_LT1C LT(_FN1, KC_CAPS) // Layer Tap 1, i.e., Tap = Caps Lock, Hold = Layer 1
#define SK_LT2A LT(_FN2, KC_APP) // Layer Tap 2, i.e., Tap = Menu, Hold = Layer 2 #define SK_LT2A LT(_FN2, KC_APP) // Layer Tap 2, i.e., Tap = Menu, Hold = Layer 2
@ -318,23 +311,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
} }
return false; return false;
// @see: https://github.com/qmk/qmk_firmware/issues/10111#issuecomment-752300353
case KC_MCON:
if (record->event.pressed) {
host_consumer_send(_AC_SHOW_ALL_WINDOWS);
} else {
host_consumer_send(0);
}
return false;
case KC_LPAD:
if (record->event.pressed) {
host_consumer_send(_AC_SHOW_ALL_APPS);
} else {
host_consumer_send(0);
}
return false;
// Shift + Backspace = Delete, see: https://docs.qmk.fm/#/feature_advanced_keycodes?id=shift-backspace-for-delete // Shift + Backspace = Delete, see: https://docs.qmk.fm/#/feature_advanced_keycodes?id=shift-backspace-for-delete
case KC_BSPC: case KC_BSPC:
if (record->event.pressed) { if (record->event.pressed) {

View file

@ -24,10 +24,8 @@ typedef union {
#endif // RGB_MATRIX_ENABLE #endif // RGB_MATRIX_ENABLE
enum { enum {
KC_MCON = USER00, // macOS Open Mission Control
KC_LPAD, // macOS Open Launchpad
#ifdef RGB_MATRIX_ENABLE #ifdef RGB_MATRIX_ENABLE
RGB_TPK, // Toggle Per-Key RGB_TPK = USER00, // Toggle Per-Key
#ifndef ID67_DISABLE_UNDERGLOW #ifndef ID67_DISABLE_UNDERGLOW
RGB_TUG, // Toggle Underglow RGB_TUG, // Toggle Underglow
#endif // ID67_DISABLE_UNDERGLOW #endif // ID67_DISABLE_UNDERGLOW
@ -44,11 +42,6 @@ enum {
#endif // ID67_DISABLE_UNDERGLOW #endif // ID67_DISABLE_UNDERGLOW
#endif // RGB_MATRIX_ENABLE #endif // RGB_MATRIX_ENABLE
enum macos_consumer_usages {
_AC_SHOW_ALL_WINDOWS = 0x29F, // mapped to KC_MCON
_AC_SHOW_ALL_APPS = 0x2A0 // mapped to KC_LPAD
};
/* Special Keys */ /* Special Keys */
#define SK_LT1C LT(1, KC_CAPS) // Layer Tap 1, i.e., Tap = Caps Lock, Hold = Layer 1 #define SK_LT1C LT(1, KC_CAPS) // Layer Tap 1, i.e., Tap = Caps Lock, Hold = Layer 1
#define SK_LT2A LT(2, KC_APP) // Layer Tap 2, i.e., Tap = Menu, Hold = Layer 2 #define SK_LT2A LT(2, KC_APP) // Layer Tap 2, i.e., Tap = Menu, Hold = Layer 2
@ -319,23 +312,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
} }
return false; return false;
// @see: https://github.com/qmk/qmk_firmware/issues/10111#issuecomment-752300353
case KC_MCON:
if (record->event.pressed) {
host_consumer_send(_AC_SHOW_ALL_WINDOWS);
} else {
host_consumer_send(0);
}
return false;
case KC_LPAD:
if (record->event.pressed) {
host_consumer_send(_AC_SHOW_ALL_APPS);
} else {
host_consumer_send(0);
}
return false;
default: default:
return true; /* Process all other keycodes normally */ return true; /* Process all other keycodes normally */
} }

View file

@ -16,16 +16,9 @@ enum {
}; };
enum { enum {
KC_MCON = USER00,
KC_LPAD,
KB_VRSN = SAFE_RANGE KB_VRSN = SAFE_RANGE
}; };
enum macos_consumer_usages {
_AC_SHOW_ALL_WINDOWS = 0x29F, // mapped to KC_MCON
_AC_SHOW_ALL_APPS = 0x2A0 // mapped to KC_LPAD
};
#define LT1_C_L LT(_FN1, KC_CAPS) #define LT1_C_L LT(_FN1, KC_CAPS)
#ifndef MIN #ifndef MIN
@ -273,23 +266,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
} }
return false; return false;
// @see: https://github.com/qmk/qmk_firmware/issues/10111#issuecomment-752300353
case KC_MCON:
if (record->event.pressed) {
host_consumer_send(_AC_SHOW_ALL_WINDOWS);
} else {
host_consumer_send(0);
}
return false;
case KC_LPAD:
if (record->event.pressed) {
host_consumer_send(_AC_SHOW_ALL_APPS);
} else {
host_consumer_send(0);
}
return false;
default: default:
return true; /* Process all other keycodes normally */ return true; /* Process all other keycodes normally */
} }

View file

@ -29,10 +29,8 @@ enum {
}; };
enum { enum {
KC_MCON = USER00, // macOS Open Mission Control
KC_LPAD, // macOS Open Launchpad
#ifdef RGB_MATRIX_ENABLE #ifdef RGB_MATRIX_ENABLE
RGB_TPK, // Toggle Per-Key RGB_TPK = USER00, // Toggle Per-Key
RGB_TUG, // Toggle Underglow RGB_TUG, // Toggle Underglow
#endif // RGB_MATRIX_ENABLE #endif // RGB_MATRIX_ENABLE
KB_VRSN = USER09 // debug, type version KB_VRSN = USER09 // debug, type version
@ -43,11 +41,6 @@ enum {
#define RGB_TUG _______ #define RGB_TUG _______
#endif // RGB_MATRIX_ENABLE #endif // RGB_MATRIX_ENABLE
enum macos_consumer_usages {
_AC_SHOW_ALL_WINDOWS = 0x29F, // mapped to KC_MCON
_AC_SHOW_ALL_APPS = 0x2A0 // mapped to KC_LPAD
};
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* /*
* *
@ -293,23 +286,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
} }
return false; return false;
// @see: https://github.com/qmk/qmk_firmware/issues/10111#issuecomment-752300353
case KC_MCON:
if (record->event.pressed) {
host_consumer_send(_AC_SHOW_ALL_WINDOWS);
} else {
host_consumer_send(0);
}
return false;
case KC_LPAD:
if (record->event.pressed) {
host_consumer_send(_AC_SHOW_ALL_APPS);
} else {
host_consumer_send(0);
}
return false;
default: default:
return true; /* Process all other keycodes normally */ return true; /* Process all other keycodes normally */
} }

View file

@ -22,10 +22,8 @@ typedef union {
#endif // RGB_MATRIX_ENABLE #endif // RGB_MATRIX_ENABLE
enum { enum {
KC_MCON = USER00, // macOS Open Mission Control
KC_LPAD, // macOS Open Launchpad
#ifdef RGB_MATRIX_ENABLE #ifdef RGB_MATRIX_ENABLE
RGB_TPK, // Toggle Per-Key RGB_TPK = USER00, // Toggle Per-Key
RGB_TUG, // Toggle Underglow RGB_TUG, // Toggle Underglow
#endif // RGB_MATRIX_ENABLE #endif // RGB_MATRIX_ENABLE
KB_VRSN = USER09 // debug, type version KB_VRSN = USER09 // debug, type version
@ -36,11 +34,6 @@ enum {
#define RGB_TUG _______ #define RGB_TUG _______
#endif #endif
enum macos_consumer_usages {
_AC_SHOW_ALL_WINDOWS = 0x29F, // mapped to KC_MCON
_AC_SHOW_ALL_APPS = 0x2A0 // mapped to KC_LPAD
};
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* /*
* *
@ -277,23 +270,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
} }
return false; return false;
// @see: https://github.com/qmk/qmk_firmware/issues/10111#issuecomment-752300353
case KC_MCON:
if (record->event.pressed) {
host_consumer_send(_AC_SHOW_ALL_WINDOWS);
} else {
host_consumer_send(0);
}
return false;
case KC_LPAD:
if (record->event.pressed) {
host_consumer_send(_AC_SHOW_ALL_APPS);
} else {
host_consumer_send(0);
}
return false;
default: default:
return true; /* Process all other keycodes normally */ return true; /* Process all other keycodes normally */
} }