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 CHARYBDIS_CONFIG_SYNC
#define POINTING_DEVICE_AUTO_MOUSE_ENABLE #define POINTING_DEVICE_AUTO_MOUSE_ENABLE
#define AUTO_MOUSE_DEFAULT_LAYER 10 #define AUTO_MOUSE_DEFAULT_LAYER 10
#define AUTO_MOUSE_TIME 650 #define AUTO_MOUSE_TIME 300
#define AUTO_MOUSE_DELAY TAPPING_TERM // #define AUTO_MOUSE_DELAY TAPPING_TERM
#define CHARYBDIS_DRAGSCROLL_REVERSE_Y #define CHARYBDIS_DRAGSCROLL_REVERSE_Y

View file

@ -123,11 +123,23 @@ layer_state_t layer_state_set_user(layer_state_t state) {
state = remove_auto_mouse_layer(state, false); state = remove_auto_mouse_layer(state, false);
set_auto_mouse_enable(false); set_auto_mouse_enable(false);
break; break;
default: default:
set_auto_mouse_enable(true); set_auto_mouse_enable(true);
break; break;
} }
// recommend that any code that makes adjustment based on auto mouse layer state would go here // 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; return state;
} }

View file

@ -41,6 +41,7 @@ void appcmd(uint16_t keycode) {
// process_record_user // process_record_user
bool process_record_user(uint16_t keycode, keyrecord_t *record) { bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) { switch (keycode) {
case THUMB_L2: case THUMB_L2:
case THUMB_L3: case THUMB_L3:
@ -480,6 +481,7 @@ uint16_t get_tapping_term(uint16_t keycode, keyrecord_t *record) {
// case SFTT_F: // case SFTT_F:
// case CTLT_D: // case CTLT_D:
// return TAPPING_TERM ; // return TAPPING_TERM ;
case SFTT_F:
case LGUI_T(KC_Z): case LGUI_T(KC_Z):
return TAPPING_TERM + 200; return TAPPING_TERM + 200;
case SFTT_J: 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_R1:
case THUMB_R3: case THUMB_R3:
case SFT_CAPS: case SFT_CAPS:
//case SFTT_A: case SFTT_A:
// case SFTT_Z: // case SFTT_Z:
// case GUIT_Z: // case GUIT_Z:
// case SFTT_F: case SFTT_F:
// case SFTT_J: // case SFTT_J:
// case ALTT_S: // case ALTT_S:
// case CTLT_D: // case CTLT_D:
@ -549,16 +551,23 @@ switch (tap_hold_keycode) {
case LSFT_T(KC_A): case LSFT_T(KC_A):
if (other_keycode == KC_W || other_keycode == KC_E || other_keycode == KC_R || other_keycode == KC_T) { if (other_keycode == KC_W || other_keycode == KC_E || other_keycode == KC_R || other_keycode == KC_T) {
return true; return true;
} } else {return false;}
break; break;
case LSFT_T(KC_F): case LSFT_T(KC_F):
if (other_keycode == KC_Q) { if (other_keycode == KC_Q) {
return true; return true;
} } else {return false;}
break; 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. // Otherwise defer to the opposite hands rule.
return get_chordal_hold_default(tap_hold_record, other_record); return get_chordal_hold_default(tap_hold_record, other_record);