2019-09-25 09:21:07 -07:00
|
|
|
#include "quantum.h"
|
|
|
|
#include "dshields.h"
|
2019-09-21 11:04:27 -07:00
|
|
|
|
|
|
|
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
2021-02-27 22:07:55 -08:00
|
|
|
if ((keycode >= QK_MOD_TAP && keycode <= QK_MOD_TAP_MAX)
|
|
|
|
|| (keycode >= QK_LAYER_TAP && keycode <= QK_LAYER_TAP_MAX)
|
|
|
|
|| (keycode >= QK_MODS && keycode <= QK_MODS_MAX)) {
|
|
|
|
keycode = keycode & 0xFF;
|
|
|
|
}
|
2019-09-25 09:21:07 -07:00
|
|
|
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;
|
2019-09-21 11:04:27 -07:00
|
|
|
}
|
2019-09-25 09:21:07 -07:00
|
|
|
return true;
|
2019-09-21 11:04:27 -07:00
|
|
|
}
|
|
|
|
|
2022-12-12 07:52:22 -08:00
|
|
|
uint16_t get_quick_tap_term(uint16_t keycode, keyrecord_t *record) {
|
2022-09-25 20:38:37 -07:00
|
|
|
switch (keycode) {
|
|
|
|
case MT_A:
|
|
|
|
case MT_S:
|
|
|
|
case MT_D:
|
|
|
|
case MT_F:
|
|
|
|
case MT_J:
|
|
|
|
case MT_K:
|
|
|
|
case MT_L:
|
|
|
|
case MT_SCLN:
|
2022-12-12 07:52:22 -08:00
|
|
|
return 0;
|
2022-09-25 20:38:37 -07:00
|
|
|
default:
|
2022-12-12 07:52:22 -08:00
|
|
|
return QUICK_TAP_TERM;
|
2022-09-25 20:38:37 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
bool get_permissive_hold(uint16_t keycode, keyrecord_t *record) {
|
|
|
|
switch (keycode) {
|
|
|
|
case MT_SPC:
|
|
|
|
case MT_BSPC:
|
|
|
|
case MT_ESC:
|
|
|
|
return true;
|
|
|
|
default:
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|