mirror of
https://github.com/Keychron/qmk_firmware.git
synced 2024-12-25 18:48:05 +06:00
00abe5d8ed
- Add oneshot mod/layer unlocking - Fix Planck rev 3 backlight breathing - Fix Planck rev 6 build with arm gcc 9.2.0 - General code clean up
32 lines
868 B
C
32 lines
868 B
C
#include "quantum.h"
|
|
#include "dshields.h"
|
|
|
|
extern bool process_record_dynamic_macro(uint16_t keycode, keyrecord_t *record);
|
|
|
|
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
|
if (!process_record_dynamic_macro(keycode, record)) {
|
|
return false;
|
|
}
|
|
if (keycode == KC_ESC && record->event.pressed) {
|
|
bool rc = true;
|
|
uint8_t mods = 0;
|
|
if ((mods = get_oneshot_mods()) && !has_oneshot_mods_timed_out()) {
|
|
clear_oneshot_mods();
|
|
unregister_mods(mods);
|
|
rc = false;
|
|
}
|
|
if ((mods = get_oneshot_locked_mods())) {
|
|
clear_oneshot_locked_mods();
|
|
unregister_mods(mods);
|
|
rc = false;
|
|
}
|
|
if (is_oneshot_layer_active()) {
|
|
layer_clear();
|
|
rc = false;
|
|
}
|
|
return rc;
|
|
}
|
|
return true;
|
|
}
|
|
|