update config to current qmk
This commit is contained in:
parent
af5e252f24
commit
8a894933e0
9 changed files with 36 additions and 118 deletions
|
@ -1,4 +1,4 @@
|
|||
// Copyright 2022 Google LLC
|
||||
// Copyright 2022-2023 Google LLC
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
|
@ -74,12 +74,11 @@ bool process_achordion(uint16_t keycode, keyrecord_t* record) {
|
|||
}
|
||||
|
||||
// Determine whether the current event is for a mod-tap or layer-tap key.
|
||||
const bool is_mt = QK_MOD_TAP <= keycode && keycode <= QK_MOD_TAP_MAX;
|
||||
const bool is_tap_hold =
|
||||
is_mt || (QK_LAYER_TAP <= keycode && keycode <= QK_LAYER_TAP_MAX);
|
||||
const bool is_mt = IS_QK_MOD_TAP(keycode);
|
||||
const bool is_tap_hold = is_mt || IS_QK_LAYER_TAP(keycode);
|
||||
// Check key position to avoid acting on combos.
|
||||
const bool is_physical_pos =
|
||||
(record->event.key.row < 254 && record->event.key.col < 254);
|
||||
const bool is_physical_pos = (record->event.key.row < KEYLOC_COMBO &&
|
||||
record->event.key.col < KEYLOC_COMBO);
|
||||
|
||||
if (achordion_state == STATE_RELEASED) {
|
||||
if (is_tap_hold && record->tap.count == 0 && record->event.pressed &&
|
||||
|
@ -94,7 +93,7 @@ bool process_achordion(uint16_t keycode, keyrecord_t* record) {
|
|||
hold_timer = record->event.time + timeout;
|
||||
|
||||
if (is_mt) { // Apply mods immediately if they are "eager."
|
||||
uint8_t mod = (tap_hold_keycode >> 8) & 0x1f;
|
||||
uint8_t mod = mod_config(QK_MOD_TAP_GET_MODS(tap_hold_keycode));
|
||||
if (achordion_eager_mod(mod)) {
|
||||
eager_mods = ((mod & 0x10) == 0) ? mod : (mod << 4);
|
||||
register_mods(eager_mods);
|
||||
|
@ -210,16 +209,7 @@ __attribute__((weak)) uint16_t achordion_timeout(uint16_t tap_hold_keycode) {
|
|||
return 1000;
|
||||
}
|
||||
|
||||
// By default, hold Shift and Ctrl mods eagerly.
|
||||
// By default, Shift and Ctrl mods are eager, and Alt and GUI are not.
|
||||
__attribute__((weak)) bool achordion_eager_mod(uint8_t mod) {
|
||||
switch (mod) {
|
||||
case MOD_LSFT:
|
||||
case MOD_RSFT:
|
||||
case MOD_LCTL:
|
||||
case MOD_RCTL:
|
||||
return true;
|
||||
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
return (mod & (MOD_LALT | MOD_LGUI)) == 0;
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright 2022 Google LLC
|
||||
// Copyright 2022-2023 Google LLC
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
|
@ -134,22 +134,15 @@ uint16_t achordion_timeout(uint16_t tap_hold_keycode);
|
|||
* key is still being settled. This is helpful to reduce delay particularly when
|
||||
* using mod-tap keys with an external mouse.
|
||||
*
|
||||
* Define this callback in your keymap.c. The default callback is
|
||||
* Define this callback in your keymap.c. The default callback is eager for
|
||||
* Shift and Ctrl, and not for Alt and GUI:
|
||||
*
|
||||
* bool achordion_eager_mod(uint8_t mod) {
|
||||
* switch (mod) {
|
||||
* case MOD_LSFT:
|
||||
* case MOD_RSFT:
|
||||
* case MOD_LCTL:
|
||||
* case MOD_RCTL:
|
||||
* return true; // Eagerly apply Shift and Ctrl mods.
|
||||
*
|
||||
* default:
|
||||
* return false;
|
||||
* }
|
||||
* return (mod & (MOD_LALT | MOD_LGUI)) == 0;
|
||||
* }
|
||||
*
|
||||
* @note `mod` should be compared with `MOD_` prefixed codes, not `KC_` codes.
|
||||
* @note `mod` should be compared with `MOD_` prefixed codes, not `KC_` codes,
|
||||
* described at <https://docs.qmk.fm/#/mod_tap>.
|
||||
*
|
||||
* @param mod Modifier `MOD_` code.
|
||||
* @return True if the modifier should be eagerly applied.
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
#define IGNORE_MOD_TAP_INTERRUPT
|
||||
|
||||
// Enable rapid switch from tap to hold, disables double tap hold auto-repeat.
|
||||
#define TAPPING_FORCE_HOLD
|
||||
#define QUICK_TAP_TERM 0
|
||||
|
||||
// try to be more permissive with holds, allows to trigger modifiers faster
|
||||
// achordion will avoid the worst
|
||||
|
@ -73,17 +73,3 @@
|
|||
|
||||
// we want to have different backlight per layers
|
||||
#define RGBLIGHT_LAYERS
|
||||
|
||||
//
|
||||
// remove some features we don't need
|
||||
//
|
||||
|
||||
// not more than 8 layers
|
||||
#define LAYER_STATE_8BIT
|
||||
|
||||
// we don't need locking
|
||||
#undef LOCKING_SUPPORT_ENABLE
|
||||
#undef LOCKING_RESYNC_ENABLE
|
||||
|
||||
// we don't use one shot keys
|
||||
#define NO_ACTION_ONESHOT
|
||||
|
|
|
@ -18,3 +18,6 @@ CAPS_WORD_ENABLE = yes
|
|||
|
||||
# add achordion to improve home row modifiers
|
||||
SRC += achordion.c
|
||||
|
||||
# per key debounce: https://github.com/qmk/qmk_firmware/blob/master/docs/feature_debounce_type.md
|
||||
DEBOUNCE_TYPE = sym_defer_pk
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue