Skip to content

Commit

Permalink
Enable chordal hold on right side
Browse files Browse the repository at this point in the history
  • Loading branch information
filterpaper committed Feb 3, 2025
1 parent f4ef90e commit 5fb4d8d
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
3 changes: 3 additions & 0 deletions config.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@

#ifdef SPLIT_KEYBOARD
# define EE_HANDS
# ifdef INIT_EE_HANDS_RIGHT
# define CHORDAL_HOLD
# endif
#endif

#ifdef COMBO_ENABLE
Expand Down
23 changes: 22 additions & 1 deletion filterpaper.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,27 @@ bool pre_process_record_user(uint16_t keycode, keyrecord_t *record) {
}


#ifdef CHORDAL_HOLD
char chordal_hold_handedness(keypos_t key) {
// Exempt thumb key rows
if (key.row == 3 || key.row == 7) return '*';
return key.row < MATRIX_ROWS / 2 ? 'L' : 'R';
}

bool get_chordal_hold(uint16_t tap_hold_keycode, keyrecord_t* tap_hold_record,
uint16_t other_keycode, keyrecord_t* other_record) {
// Allow Shift modifier combination
if (IS_MOD_TAP_CAG(tap_hold_keycode) && IS_MOD_TAP_SHIFT(other_keycode)) return true;
// Prevent shortcut key chords
else if (IS_SHORTCUT(tap_hold_keycode)) return false;
// Otherwise defer to the opposite hands rule
return get_chordal_hold_default(tap_hold_record, other_record);
}
#endif


bool get_hold_on_other_key_press(uint16_t keycode, keyrecord_t *record) {
#ifndef CHORDAL_HOLD
// Press the tap keycode when a mod-tap key overlaps with a non-Shift key
// on the same hand or when a shortcut key overlaps with any key
if ((IS_UNILATERAL(record, inter_record) && !IS_MOD_TAP_SHIFT(inter_keycode)) || IS_SHORTCUT(keycode)) {
Expand All @@ -67,8 +87,9 @@ bool get_hold_on_other_key_press(uint16_t keycode, keyrecord_t *record) {
process_record(record);
return false;
}
#endif
// Activate layer hold with another key press
else return IS_LAYER_TAP(keycode);
return IS_LAYER_TAP(keycode);
}


Expand Down

0 comments on commit 5fb4d8d

Please sign in to comment.