[Keymap] Personal Keymap (nathanvercaemert) Update (#10107)

* updates to incorporate combined mouse key acceleration functionality

* tab switching in chrome works, updated readme

* updated keymap image

* updated keymap image

Co-authored-by: Nathan Vercaemert <nathan.vercaemert@gmail.com>
This commit is contained in:
nathanvercaemert 2020-09-06 20:55:39 -04:00 committed by GitHub
parent 8ea8a80c5b
commit 92e5361fc5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 111 additions and 25 deletions

View File

@ -18,6 +18,9 @@
#undef MOUSEKEY_WHEEL_INTERVAL #undef MOUSEKEY_WHEEL_INTERVAL
#define MOUSEKEY_WHEEL_INTERVAL 50 #define MOUSEKEY_WHEEL_INTERVAL 50
#undef MK_COMBINED
#define MK_COMBINED
// /* Temporarily defining a tapping term that is ridiculous to see if i can tell if lt is working. */ // /* Temporarily defining a tapping term that is ridiculous to see if i can tell if lt is working. */
// #undef TAPPING_TERM // #undef TAPPING_TERM
// #define TAPPING_TERM 499 // #define TAPPING_TERM 499

View File

@ -28,13 +28,17 @@
enum custom_keycodes { enum custom_keycodes {
RGB_SLD = EZ_SAFE_RANGE, RGB_SLD = EZ_SAFE_RANGE,
MS_WH_UP,
MS_WH_DOWN,
MS_WH_RIGHT,
MS_WH_LEFT,
}; };
// tapdance keycodes // tapdance keycodes
enum td_keycodes { enum td_keycodes {
CTRL_TO12, CTRL_TO12,
SHIFT_TO13, SHIFT_TO13,
ALT_TO11 ALT_TO11,
}; };
// define a type containing as many tapdance states as you need // define a type containing as many tapdance states as you need
@ -59,6 +63,7 @@ void altto11_reset (qk_tap_dance_state_t *state, void *user_data);
void shiftto13_finished (qk_tap_dance_state_t *state, void *user_data); void shiftto13_finished (qk_tap_dance_state_t *state, void *user_data);
void shiftto13_reset (qk_tap_dance_state_t *state, void *user_data); void shiftto13_reset (qk_tap_dance_state_t *state, void *user_data);
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[0] = LAYOUT_ergodox_pretty( [0] = LAYOUT_ergodox_pretty(
KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,
@ -162,9 +167,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
), ),
[10] = LAYOUT_ergodox_pretty( [10] = LAYOUT_ergodox_pretty(
KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT,
KC_TRANSPARENT, KC_NO, KC_LGUI, KC_MS_BTN2, KC_NO, KC_NO, KC_TRANSPARENT, MT(MOD_RCTL, KC_A), KC_NO, KC_NO, KC_MS_UP, KC_NO, KC_NO, KC_TRANSPARENT, KC_TRANSPARENT, KC_NO, KC_LGUI, KC_MS_BTN2, KC_ACL2, KC_NO, KC_TRANSPARENT, KC_TRANSPARENT, KC_NO, KC_NO, KC_MS_UP, KC_NO, KC_NO, KC_TRANSPARENT,
KC_TRANSPARENT, TD(SHIFT_TO13), TD(CTRL_TO12), TD(ALT_TO11), KC_MS_BTN1, KC_NO, KC_NO, KC_MS_LEFT, KC_MS_DOWN, KC_MS_RIGHT, KC_NO, KC_TRANSPARENT, KC_TRANSPARENT, TD(SHIFT_TO13), TD(CTRL_TO12), TD(ALT_TO11), KC_MS_BTN1, KC_NO, KC_NO, KC_MS_LEFT, KC_MS_DOWN, KC_MS_RIGHT, KC_NO, KC_TRANSPARENT,
KC_TRANSPARENT, KC_NO, MT(MOD_LGUI | MOD_LCTL,KC_NO), KC_NO, KC_NO, KC_NO, KC_TRANSPARENT, KC_TRANSPARENT, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TRANSPARENT, KC_TRANSPARENT, KC_NO, MT(MOD_LGUI | MOD_LCTL,KC_NO), KC_ACL0, KC_NO, KC_NO, KC_TRANSPARENT, KC_TRANSPARENT, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TRANSPARENT,
KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT,
KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT,
KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT,
@ -182,9 +187,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
), ),
[12] = LAYOUT_ergodox_pretty( [12] = LAYOUT_ergodox_pretty(
KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT,
KC_TRANSPARENT, KC_NO, KC_LGUI, KC_HYPR, KC_NO, KC_NO, KC_TRANSPARENT, KC_TRANSPARENT, KC_NO, KC_NO, KC_MS_WH_UP, KC_NO, KC_NO, KC_TRANSPARENT, KC_TRANSPARENT, KC_NO, KC_LGUI, KC_HYPR, KC_ACL2, KC_NO, KC_TRANSPARENT, KC_TRANSPARENT, KC_NO, KC_NO, KC_MS_WH_UP, KC_NO, KC_NO, KC_TRANSPARENT,
KC_TRANSPARENT, KC_LSHIFT, KC_LCTRL, KC_LALT, KC_NO, KC_NO, KC_NO, KC_MS_WH_LEFT, KC_MS_WH_DOWN, KC_MS_WH_RIGHT, KC_NO, KC_TRANSPARENT, KC_TRANSPARENT, KC_LSHIFT, KC_LCTRL, KC_LALT, KC_NO, KC_NO, KC_NO, KC_MS_WH_LEFT, KC_MS_WH_DOWN, KC_MS_WH_RIGHT, KC_NO, KC_TRANSPARENT,
KC_TRANSPARENT, KC_NO, MT(MOD_LGUI | MOD_LCTL,KC_NO), KC_NO, KC_NO, KC_NO, KC_TRANSPARENT, KC_TRANSPARENT, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TRANSPARENT, KC_TRANSPARENT, KC_NO, MT(MOD_LGUI | MOD_LCTL,KC_NO), MO(14), KC_NO, KC_NO, KC_TRANSPARENT, KC_TRANSPARENT, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TRANSPARENT,
KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT,
KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT,
KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT,
@ -200,16 +205,18 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT,
KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, TO(0) KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, TO(0)
), ),
[14] = LAYOUT_ergodox_pretty(
KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT,
KC_TRANSPARENT, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TRANSPARENT, KC_TRANSPARENT, KC_NO, KC_NO, MS_WH_UP, KC_NO, KC_NO, KC_TRANSPARENT,
KC_TRANSPARENT, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, MS_WH_LEFT, MS_WH_DOWN, MS_WH_RIGHT, KC_NO, KC_TRANSPARENT,
KC_TRANSPARENT, KC_NO, KC_NO, KC_TRANSPARENT, KC_NO, KC_NO, KC_TRANSPARENT, KC_TRANSPARENT, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TRANSPARENT,
KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT,
KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT,
KC_TRANSPARENT, KC_TRANSPARENT,
KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT
),
}; };
/* Commenting out for debug purposes */
// bool process_record_user(uint16_t keycode, keyrecord_t *record) {
// switch (keycode) {
// }
// return true;
// }
uint32_t layer_state_set_user(uint32_t state) { uint32_t layer_state_set_user(uint32_t state) {
uint8_t layer = biton32(state); uint8_t layer = biton32(state);
ergodox_board_led_off(); ergodox_board_led_off();
@ -252,11 +259,31 @@ uint32_t layer_state_set_user(uint32_t state) {
// determine the tapdance state to return // determine the tapdance state to return
int cur_dance (qk_tap_dance_state_t *state) { int cur_dance (qk_tap_dance_state_t *state) {
if (state->count == 1) { if (state->count == 1) {
if (state->interrupted || !state->pressed) { return SINGLE_TAP; } if (state->interrupted && state->pressed && state->interrupting_keycode == KC_MS_BTN1) {return SINGLE_HOLD;}
if (state->interrupted && state->pressed && state->interrupting_keycode == 22273) {return SINGLE_HOLD;}
if (state->interrupted && state->pressed && state->interrupting_keycode == 22272) {return SINGLE_HOLD;}
if (state->interrupted && state->pressed && state->interrupting_keycode == KC_TAB) {return SINGLE_HOLD;}
else if (state->interrupted || !state->pressed) {
// if (state->interrupted) {
// print("interrupted\n");
// uprintf("Shift: %u\n", KC_LSHIFT);
// uprintf("Control: %u\n", KC_LCTRL);
// uprintf("%u\n",state->interrupting_keycode);
// }
return SINGLE_TAP;
}
else { return SINGLE_HOLD; } else { return SINGLE_HOLD; }
} }
else { return 2; } // any number higher than the maximum state value you return above else { return 2; } // any number higher than the maximum state value you return above
} }
// /* Backup in case previous code is hard to piece together. */
// int cur_dance (qk_tap_dance_state_t *state) {
// if (state->count == 1) {
// if (state->interrupted || !state->pressed) { return SINGLE_TAP; }
// else { return SINGLE_HOLD; }
// }
// else { return 2; } // any number higher than the maximum state value you return above
// }
void ctrlto12_finished (qk_tap_dance_state_t *state, void *user_data) { void ctrlto12_finished (qk_tap_dance_state_t *state, void *user_data) {
td_state = cur_dance(state); td_state = cur_dance(state);
@ -265,7 +292,14 @@ void ctrlto12_finished (qk_tap_dance_state_t *state, void *user_data) {
layer_on(12); layer_on(12);
break; break;
case SINGLE_HOLD: case SINGLE_HOLD:
if (state->interrupted && (state->interrupting_keycode == 22273 || state->interrupting_keycode == 43)) {
register_mods(MOD_BIT(KC_LCTRL));
break;
}
register_mods(MOD_BIT(KC_LCTRL)); // for a layer-tap key, use `layer_on(_MY_LAYER)` here register_mods(MOD_BIT(KC_LCTRL)); // for a layer-tap key, use `layer_on(_MY_LAYER)` here
if (state->interrupted && state->interrupting_keycode == KC_MS_BTN1) {
register_code16(LCTL(KC_MS_BTN1));
}
break; break;
} }
} }
@ -275,7 +309,14 @@ void ctrlto12_reset (qk_tap_dance_state_t *state, void *user_data) {
case SINGLE_TAP: case SINGLE_TAP:
break; break;
case SINGLE_HOLD: case SINGLE_HOLD:
if (state->interrupted && (state->interrupting_keycode == 22273 || state->interrupting_keycode == 43) ) {
unregister_mods(MOD_BIT(KC_LCTRL));
break;
}
unregister_mods(MOD_BIT(KC_LCTRL)); // for a layer-tap key, use `layer_off(_MY_LAYER)` here unregister_mods(MOD_BIT(KC_LCTRL)); // for a layer-tap key, use `layer_off(_MY_LAYER)` here
if (state->interrupted && state->interrupting_keycode == KC_MS_BTN1) {
unregister_code16(LCTL(KC_MS_BTN1));
}
break; break;
} }
} }
@ -287,7 +328,14 @@ void shiftto13_finished (qk_tap_dance_state_t *state, void *user_data) {
layer_on(13); layer_on(13);
break; break;
case SINGLE_HOLD: case SINGLE_HOLD:
if (state->interrupted && (state->interrupting_keycode == 22272 || state->interrupting_keycode == 43) ) {
register_mods(MOD_BIT(KC_LSHIFT));
break;
}
register_mods(MOD_BIT(KC_LSHIFT)); // for a layer-tap key, use `layer_on(_MY_LAYER)` here register_mods(MOD_BIT(KC_LSHIFT)); // for a layer-tap key, use `layer_on(_MY_LAYER)` here
if (state->interrupted && state->interrupting_keycode == KC_MS_BTN1) {
register_code16(LSFT(KC_MS_BTN1));
}
break; break;
} }
} }
@ -297,7 +345,14 @@ void shiftto13_reset (qk_tap_dance_state_t *state, void *user_data) {
case SINGLE_TAP: case SINGLE_TAP:
break; break;
case SINGLE_HOLD: case SINGLE_HOLD:
if (state->interrupted && (state->interrupting_keycode == 22272 || state->interrupting_keycode == 43) ) {
unregister_mods(MOD_BIT(KC_LSHIFT));
break;
}
unregister_mods(MOD_BIT(KC_LSHIFT)); // for a layer-tap key, use `layer_off(_MY_LAYER)` here unregister_mods(MOD_BIT(KC_LSHIFT)); // for a layer-tap key, use `layer_off(_MY_LAYER)` here
if (state->interrupted && state->interrupting_keycode == KC_MS_BTN1) {
unregister_code16(LSFT(KC_MS_BTN1));
}
break; break;
} }
} }
@ -310,6 +365,9 @@ void altto11_finished (qk_tap_dance_state_t *state, void *user_data) {
break; break;
case SINGLE_HOLD: case SINGLE_HOLD:
register_mods(MOD_BIT(KC_LALT)); // for a layer-tap key, use `layer_on(_MY_LAYER)` here register_mods(MOD_BIT(KC_LALT)); // for a layer-tap key, use `layer_on(_MY_LAYER)` here
if (state->interrupted && state->interrupting_keycode == KC_MS_BTN1) {
register_code16(LALT(KC_MS_BTN1));
}
break; break;
} }
} }
@ -320,6 +378,9 @@ void altto11_reset (qk_tap_dance_state_t *state, void *user_data) {
break; break;
case SINGLE_HOLD: case SINGLE_HOLD:
unregister_mods(MOD_BIT(KC_LALT)); // for a layer-tap key, use `layer_off(_MY_LAYER)` here unregister_mods(MOD_BIT(KC_LALT)); // for a layer-tap key, use `layer_off(_MY_LAYER)` here
if (state->interrupted && state->interrupting_keycode == KC_MS_BTN1) {
unregister_code16(LALT(KC_MS_BTN1));
}
break; break;
} }
} }
@ -328,7 +389,7 @@ void altto11_reset (qk_tap_dance_state_t *state, void *user_data) {
qk_tap_dance_action_t tap_dance_actions[] = { qk_tap_dance_action_t tap_dance_actions[] = {
[CTRL_TO12] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, ctrlto12_finished, ctrlto12_reset), [CTRL_TO12] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, ctrlto12_finished, ctrlto12_reset),
[SHIFT_TO13] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, shiftto13_finished, shiftto13_reset), [SHIFT_TO13] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, shiftto13_finished, shiftto13_reset),
[ALT_TO11] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, altto11_finished, altto11_reset) [ALT_TO11] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, altto11_finished, altto11_reset),
}; };
/* Debugging functions */ /* Debugging functions */
@ -342,10 +403,32 @@ void keyboard_post_init_user(void) {
} }
bool process_record_user(uint16_t keycode, keyrecord_t *record) { bool process_record_user(uint16_t keycode, keyrecord_t *record) {
// If console is enabled, it will print the matrix position and status of each key pressed // If console is enabled, it will print the matrix position and status of each key pressed
// #ifdef CONSOLE_ENABLE // #ifdef CONSOLE_ENABLE
// uprintf("KL: kc: %u, col: %u, row: %u, pressed: %u\n", keycode, record->event.key.col, record->event.key.row, record->event.pressed); // uprintf("KL: kc: %u, col: %u, row: %u, pressed: %u\n", keycode, record->event.key.col, record->event.key.row, record->event.pressed);
// #endif // #endif
return true; switch (keycode) {
case MS_WH_DOWN:
if (record->event.pressed) {
SEND_STRING(SS_TAP(X_MS_WH_DOWN));
}
break;
case MS_WH_UP:
if (record->event.pressed) {
SEND_STRING(SS_TAP(X_MS_WH_UP));
}
break;
case MS_WH_LEFT:
if (record->event.pressed) {
SEND_STRING(SS_TAP(X_MS_WH_LEFT));
}
break;
case MS_WH_RIGHT:
if (record->event.pressed) {
SEND_STRING(SS_TAP(X_MS_WH_RIGHT));
}
break;
}
return true;
} }

View File

@ -1,7 +1,6 @@
# The nathanvercaemert ErgoDox EZ configuration # The nathanvercaemert ErgoDox EZ configuration
Centered around the home row and the use of mouse keys, this configuration focuses Centered around the home row and the use of mouse keys, this configuration focuses on minimal finger movement. No key is more than one unit away from the home row.
on minimal finger movement. No key is more than one unit away from a finger on the home row.
## Layers ## Layers
@ -20,7 +19,9 @@ on minimal finger movement. No key is more than one unit away from a finger on t
navigation layers. navigation layers.
* Navigation Layers * Navigation Layers
* From the Mouse Layer, taps to the left home row navigate to scroll keys, arrow keys, and page keys. * From the Mouse Layer, taps to the left home row navigate to scroll keys, arrow keys, and page keys.
* Notes on Acceleration
* Designated as "Slow" and "Fast" on the mouse layers (movement and scroll,) these keys can be held to allow for slow/precise or fast/efficient control.
Here is the image of my keymap: Here is the image of my keymap:
![Default](https://i.imgur.com/kXywQIq.png) ![Imgur Image](https://i.imgur.com/x6VgH9Z.png)

View File

@ -5,6 +5,5 @@ COMMAND_ENABLE = no
RGBLIGHT_ENABLE = no RGBLIGHT_ENABLE = no
TAP_DANCE_ENABLE=yes TAP_DANCE_ENABLE=yes
# Debugging
#Beginning debugging process for LT() and permissive hold
CONSOLE_ENABLE = yes CONSOLE_ENABLE = yes