add seemingly working mod-tap setup

This commit is contained in:
scda 2021-06-26 19:17:55 +02:00
parent 252356411b
commit d196b9efc1
2 changed files with 55 additions and 13 deletions

View File

@ -1,9 +1,13 @@
#pragma once
/*** OLED ***/
#ifdef OLED_DRIVER_ENABLE
# define OLED_DISPLAY_128X64
#endif
/*** RGB LIGHTS ***/
#ifdef RGBLIGHT_ENABLE
# define RGBLIGHT_HUE_STEP 8
# define RGBLIGHT_SAT_STEP 8
@ -19,12 +23,45 @@
// # define RGBLIGHT_ANIMATIONS // animations disabled
#endif
// relevant for modtap on various keys
// see https://docs.qmk.fm/#/tap_hold
// #define TAPPING_TERM 4000
// #define PERMISSIVE_HOLD
/*** CONTROLLERS ***/
// see https://docs.qmk.fm/#/feature_split_keyboard?id=hardware-configuration-options
// If you are using an Elite C rev3 on the slave side, uncomment the lines below:
#define SPLIT_USB_DETECT
#define NO_USB_STARTUP_CHECK
/*** MOD_TAP ***/
/*
great guide on this topic https://precondition.github.io/home-row-mods
*/
/*
the minimum time you have to hold a key to activate the "hold" key
- used for modifiers and layer taps
- default 200
*/
#define TAPPING_TERM 400
/*
do not activate the modifier when another key is being pressed and released while the tap_key is being held before tapping_term has been reached
- prevent accidental mod usage
*/
#define IGNORE_MOD_TAP_INTERRUPT
/*
allow for hold-mod after tapping the same key for the letter itself
- disables double-tap-auto-repeat = to repeat a letter, you have to spam it instead of holding it down ..
- applies to modifier and layer taps
*/
#define TAPPING_FORCE_HOLD
/*
allow for mod-key activation, if any other key is pressed and released while the mod key is being hold
mod will then be activated even before the tapping_term has passed
- works even when IGNORE_MOD_TAP_INTERRUPT is defined
- might be useful for long tapping_term times and fast typing
- BUT might also lead to accidental mod activations (e.g. for very short, quick words)
- alternatively: see PERMISSIVE_HOLD_PER_KEY https://docs.qmk.fm/#/tap_hold?id=permissive-hold
*/
// #define PERMISSIVE_HOLD

View File

@ -3,13 +3,25 @@
enum layers { _LETTERS = 0, _SYMBOLS, _NUMBERS, _MEDIA, _KBD_CTRL };
// Left-hand home row mods
#define HOMEROW_H CTL_T(KC_H)
#define HOMEROW_A ALT_T(KC_A)
#define HOMEROW_E GUI_T(KC_E)
#define HOMEROW_I SFT_T(KC_I)
// Right-hand home row mods
#define HOMEROW_T SFT_T(KC_T)
#define HOMEROW_R GUI_T(KC_R)
#define HOMEROW_N ALT_T(KC_N)
#define HOMEROW_S CTL_T(KC_S)
// clang-format off
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_LETTERS] = LAYOUT(
G(KC_TAB), KC_X, DE_DOT, KC_O, DE_COMM, KC_Y,
KC_V, KC_G, KC_C, KC_L, KC_J, G(KC_SPC),
LT(4,KC_ESC), KC_H, KC_A, KC_E, KC_I, KC_U,
KC_D, KC_T, KC_R, KC_N, KC_S, KC_F,
LT(4,KC_ESC), HOMEROW_H, HOMEROW_A, HOMEROW_E, HOMEROW_I, KC_U,
KC_D, HOMEROW_T, HOMEROW_R, HOMEROW_N, HOMEROW_S, KC_F,
KC_NO, KC_K, KC_Q, DE_ADIA, DE_UDIA, DE_ODIA, KC_NO, KC_NO,
KC_NO, KC_NO, KC_B, KC_P, KC_W, KC_M, KC_Z, DE_SS,
KC_HOME, KC_BSPC, LT(_SYMBOLS,KC_TAB), LT(_NUMBERS,KC_SPC), LT(_MEDIA,KC_ENT),
@ -53,13 +65,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
};
// clang-format on
/*
// not fully understood yet, see https://docs.qmk.fm/#/ref_functions?id=update_tri_layer_statestate-x-y-z
// seems like layer 3 can only be accessed from layer 1 and 2 or something like that?
layer_state_t layer_state_set_user(layer_state_t state) {
return update_tri_layer_state(state, _SYMBOLS, _NUMBERS, _MEDIA);
}
*/
#ifdef OLED_DRIVER_ENABLE
oled_rotation_t oled_init_user(oled_rotation_t rotation) { return OLED_ROTATION_180; }