From 22213aae7649fc8eed90829829e80c3ed9f0bf38 Mon Sep 17 00:00:00 2001 From: Christoph Cullmann Date: Mon, 17 Oct 2022 23:29:33 +0200 Subject: add achordion to make home row keys really usable --- keymap.c | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) (limited to 'keymap.c') diff --git a/keymap.c b/keymap.c index 4b9fc57..5e1b7b3 100644 --- a/keymap.c +++ b/keymap.c @@ -63,6 +63,40 @@ KC_NO, KC_NO, K32, K33, K34, KC_NO, KC_NO, K35, K36, K37, KC_NO, KC_ // include miryoku defaults #include +// +// improve home row modifiers via achordion +// + +#include "achordion.h" + +bool process_record_user(uint16_t keycode, keyrecord_t* record) +{ + if (!process_achordion(keycode, record)) { + return false; + } + + return true; +} + +void matrix_scan_user(void) +{ + achordion_task(); +} + +bool achordion_chord(uint16_t tap_hold_keycode, + keyrecord_t* tap_hold_record, + uint16_t other_keycode, + keyrecord_t* other_record) +{ + // allow thumb key row to always work + if (other_record->event.key.row >= 3) { + return true; + } + + // Otherwise, follow the opposite hands rule. + return achordion_opposite_hands(tap_hold_record, other_record); +} + // // underglow configuration // @@ -101,7 +135,7 @@ const rgblight_segment_t PROGMEM fn_layer[] = RGBLIGHT_LAYER_SEGMENTS( const rgblight_segment_t * const PROGMEM my_rgb_layers[] = RGBLIGHT_LAYERS_LIST( [BASE] = qwerty_layer, - [NAV] = lower_layer, + [NAV] = cmd_layer, [MOUSE] = raise_layer, [MEDIA] = nav_layer, [NUM] = cmd_layer, -- cgit v1.2.3