mirror of
https://github.com/qmk/qmk_userspace.git
synced 2025-04-30 04:34:17 -04:00
Revert "feat: Make my Ctrl/Esc mod-tap an one-shot modifier"
This reverts commit f3ecc19479
.
This commit is contained in:
parent
94484b6fdc
commit
6a2bc2d40d
1 changed files with 2 additions and 20 deletions
|
@ -61,7 +61,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
//┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐
|
//┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐
|
||||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||||
//├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤
|
//├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤
|
||||||
_______, _______, TAB_EXT, TAB_PRV, TAB_NXT, TAB_NEW, KC_HOME, KC_PGDN, KC_PGUP, KC_END, XXXXXXX, KC_BSPC,
|
_______, _______, TAB_EXT, TAB_NXT, TAB_PRV, TAB_NEW, KC_HOME, KC_PGDN, KC_PGUP, KC_END, XXXXXXX, KC_BSPC,
|
||||||
//├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤
|
//├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤
|
||||||
_______, OSM_G, OSM_A, OSM_S, OSM_C, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT,SELWORD, XXXXXXX,
|
_______, OSM_G, OSM_A, OSM_S, OSM_C, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT,SELWORD, XXXXXXX,
|
||||||
//├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤
|
//├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤
|
||||||
|
@ -101,21 +101,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
)
|
)
|
||||||
};
|
};
|
||||||
|
|
||||||
// Combine MT (mod-tap) with OSM (one-shot modifiers).
|
|
||||||
// For example, the key `MT(MOD_LCTL, KC_ESC)` will act as `Escape` when tapped
|
|
||||||
// and as a one-shot `Control` when held.
|
|
||||||
// https://getreuer.info/posts/keyboards/faqs/index.html#one-shot-mod-tap-osm-mt
|
|
||||||
static bool one_shot_mod_tap(uint16_t keycode, keyrecord_t* record) {
|
|
||||||
if (record->tap.count == 0) { // key is being held
|
|
||||||
if (record->event.pressed) {
|
|
||||||
const uint8_t mods = QK_MOD_TAP_GET_MODS(keycode);
|
|
||||||
add_oneshot_mods(((mods & 0x10) == 0) ? mods : (mods << 4));
|
|
||||||
}
|
|
||||||
return false; // skip the default handling
|
|
||||||
}
|
|
||||||
return true; // default handling
|
|
||||||
}
|
|
||||||
|
|
||||||
bool process_record_user(uint16_t keycode, keyrecord_t* record) {
|
bool process_record_user(uint16_t keycode, keyrecord_t* record) {
|
||||||
// Macros
|
// Macros
|
||||||
if (record->event.pressed) {
|
if (record->event.pressed) {
|
||||||
|
@ -129,10 +114,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t* record) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (keycode) {
|
// Other macros...
|
||||||
case CTL_ESC:
|
|
||||||
return one_shot_mod_tap(keycode, record);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Select word
|
// Select word
|
||||||
if (!process_select_word(keycode, record, SELWORD)) { return false; }
|
if (!process_select_word(keycode, record, SELWORD)) { return false; }
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue