Auto mouse to press num lock, calibrate chordal hold setting

This commit is contained in:
oco9oco 2025-05-07 15:55:11 +09:00
commit 9115619c6f
3 changed files with 36 additions and 15 deletions

View file

@ -1,6 +1,6 @@
#define CHARYBDIS_CONFIG_SYNC
#define POINTING_DEVICE_AUTO_MOUSE_ENABLE
#define AUTO_MOUSE_DEFAULT_LAYER 10
#define AUTO_MOUSE_TIME 650
#define AUTO_MOUSE_DELAY TAPPING_TERM
#define AUTO_MOUSE_TIME 300
// #define AUTO_MOUSE_DELAY TAPPING_TERM
#define CHARYBDIS_DRAGSCROLL_REVERSE_Y

View file

@ -114,7 +114,7 @@ void pointing_device_init_user(void) {
}
layer_state_t layer_state_set_user(layer_state_t state) {
// checks highest layer other than target layer
// checks highest layer other than target layer
switch(get_highest_layer(remove_auto_mouse_layer(state, true))) {
case _MOUSE:
case _NAV:
@ -123,11 +123,23 @@ layer_state_t layer_state_set_user(layer_state_t state) {
state = remove_auto_mouse_layer(state, false);
set_auto_mouse_enable(false);
break;
default:
set_auto_mouse_enable(true);
break;
}
// recommend that any code that makes adjustment based on auto mouse layer state would go here
static bool mouse_layer_on = false;
bool now_on = layer_state_cmp(state, _ONEHAND);
if (now_on && !mouse_layer_on) {
// 마우스 레이어 진입 시
tap_code(KC_LCTL); // 예: 음소거 키 입력
} else if (!now_on && mouse_layer_on) {
// 마우스 레이어 탈출 시
tap_code(KC_LCTL); // 예: 볼륨업 키 입력
}
mouse_layer_on = now_on;
return state;
}

View file

@ -41,6 +41,7 @@ void appcmd(uint16_t keycode) {
// process_record_user
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case THUMB_L2:
case THUMB_L3:
@ -480,6 +481,7 @@ uint16_t get_tapping_term(uint16_t keycode, keyrecord_t *record) {
// case SFTT_F:
// case CTLT_D:
// return TAPPING_TERM ;
case SFTT_F:
case LGUI_T(KC_Z):
return TAPPING_TERM + 200;
case SFTT_J:
@ -513,10 +515,10 @@ bool get_hold_on_other_key_press(uint16_t keycode, keyrecord_t *record) {
case THUMB_R1:
case THUMB_R3:
case SFT_CAPS:
//case SFTT_A:
case SFTT_A:
// case SFTT_Z:
// case GUIT_Z:
// case SFTT_F:
case SFTT_F:
// case SFTT_J:
// case ALTT_S:
// case CTLT_D:
@ -547,18 +549,25 @@ bool get_chordal_hold(uint16_t tap_hold_keycode, keyrecord_t* tap_hold_record,
// Exceptionally allow some one-handed chords for hotkeys.
switch (tap_hold_keycode) {
case LSFT_T(KC_A):
if (other_keycode == KC_W || other_keycode == KC_E || other_keycode == KC_R || other_keycode == KC_T) {
return true;
}
break;
if (other_keycode == KC_W || other_keycode == KC_E || other_keycode == KC_R || other_keycode == KC_T) {
return true;
} else {return false;}
break;
case LSFT_T(KC_F):
if (other_keycode == KC_Q) {
return true;
}
break;
if (other_keycode == KC_Q) {
return true;
} else {return false;}
break;
case THUMB_L1:
case THUMB_L2:
case THUMB_L3:
case THUMB_R1:
case THUMB_R2:
case THUMB_R3:
return true;
break;
}
// Otherwise defer to the opposite hands rule.
return get_chordal_hold_default(tap_hold_record, other_record);