1
0
Fork 0

Rename some Quantum keycodes (#15968)

* Rename some Quantum keycodes

* Tweak EEPROM clear and debug keycode short aliases
This commit is contained in:
Ryan 2022-01-22 14:34:15 +11:00 committed by GitHub
parent c7f477bc59
commit b45a037c7e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 49 additions and 32 deletions

View file

@ -15,13 +15,13 @@
*/
#include "process_grave_esc.h"
/* true if the last press of GRAVE_ESC was shifted (i.e. GUI or SHIFT were pressed), false otherwise.
/* true if the last press of QK_GRAVE_ESCAPE was shifted (i.e. GUI or SHIFT were pressed), false otherwise.
* Used to ensure that the correct keycode is released if the key is released.
*/
static bool grave_esc_was_shifted = false;
bool process_grave_esc(uint16_t keycode, keyrecord_t *record) {
if (keycode == GRAVE_ESC) {
if (keycode == QK_GRAVE_ESCAPE) {
const uint8_t mods = get_mods();
uint8_t shifted = mods & MOD_MASK_SG;

View file

@ -302,12 +302,12 @@ bool process_record_quantum(keyrecord_t *record) {
if (record->event.pressed) {
switch (keycode) {
#ifndef NO_RESET
case RESET:
case QK_BOOTLOADER:
reset_keyboard();
return false;
#endif
#ifndef NO_DEBUG
case DEBUG:
case QK_DEBUG_TOGGLE:
debug_enable ^= 1;
if (debug_enable) {
print("DEBUG: enabled.\n");
@ -316,7 +316,7 @@ bool process_record_quantum(keyrecord_t *record) {
}
#endif
return false;
case EEPROM_RESET:
case QK_CLEAR_EEPROM:
eeconfig_init();
return false;
#ifdef VELOCIKEY_ENABLE

View file

@ -80,8 +80,8 @@ enum quantum_keycodes {
QK_UNICODEMAP_PAIR_MAX = 0xFFFF,
// Loose keycodes - to be used directly
RESET = 0x5C00,
DEBUG, // 5C01
QK_BOOTLOADER = 0x5C00,
QK_DEBUG_TOGGLE, // 5C01
// Magic
MAGIC_SWAP_CONTROL_CAPSLOCK, // 5C02
@ -106,7 +106,7 @@ enum quantum_keycodes {
MAGIC_TOGGLE_ALT_GUI, // 5C15
// Grave Escape
GRAVE_ESC, // 5C16
QK_GRAVE_ESCAPE, // 5C16
// Auto Shift
KC_ASUP, // 5C17
@ -379,7 +379,7 @@ enum quantum_keycodes {
OUT_USB, // 5CDE
// Clear EEPROM
EEPROM_RESET, // 5CDF
QK_CLEAR_EEPROM, // 5CDF
// Unicode
UNICODE_MODE_FORWARD, // 5CE0
@ -716,9 +716,11 @@ enum quantum_keycodes {
#define MACROTAP(kc) (QK_MACRO | (FUNC_TAP << 8) | (kc))
#define MACRODOWN(...) (record->event.pressed ? MACRO(__VA_ARGS__) : MACRO_NONE)
#define KC_GESC GRAVE_ESC
#define QK_GESC QK_GRAVE_ESCAPE
#define EEP_RST EEPROM_RESET
#define QK_BOOT QK_BOOTLOADER
#define DB_TOGG QK_DEBUG_TOGGLE
#define EE_CLR QK_CLEAR_EEPROM
// Audio Clicky aliases
#define CK_TOGG CLICKY_TOGGLE
@ -964,3 +966,5 @@ enum quantum_keycodes {
#define PB_32 PROGRAMMABLE_BUTTON_32
#define PROGRAMMABLE_BUTTON_MIN PROGRAMMABLE_BUTTON_1
#define PROGRAMMABLE_BUTTON_MAX PROGRAMMABLE_BUTTON_32
#include "quantum_keycodes_legacy.h"

View file

@ -0,0 +1,13 @@
#pragma once
// clang-format off
// Deprecated Quantum keycodes
#define RESET QK_BOOTLOADER
#define DEBUG QK_DEBUG_TOGGLE
#define GRAVE_ESC QK_GRAVE_ESCAPE
#define EEPROM_RESET QK_CLEAR_EEPROM
#define KC_GESC QK_GRAVE_ESCAPE
#define EEP_RST QK_CLEAR_EEPROM

View file

@ -244,12 +244,12 @@ _Static_assert(KC_LT == 0x0236, "");
_Static_assert(KC_GT == 0x0237, "");
_Static_assert(KC_QUES == 0x0238, "");
_Static_assert(RESET == 0x5C00, "");
_Static_assert(DEBUG == 0x5C01, "");
_Static_assert(QK_BOOTLOADER == 0x5C00, "");
_Static_assert(QK_DEBUG_TOGGLE == 0x5C01, "");
_Static_assert(MAGIC_TOGGLE_NKRO == 0x5C14, "");
_Static_assert(KC_GESC == 0x5C16, "");
_Static_assert(QK_GRAVE_ESCAPE == 0x5C16, "");
_Static_assert(AU_ON == 0x5C1D, "");
_Static_assert(AU_OFF == 0x5C1E, "");