Skip to content

Commit c7cfe9a

Browse files
committed
add mouse layer for mac
1 parent 196543a commit c7cfe9a

File tree

2 files changed

+33
-1
lines changed

2 files changed

+33
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#include "custom_config.h"
2+
3+
// Function to handle the custom keycode action
4+
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
5+
switch (keycode) {
6+
case DOUBLE_ESC:
7+
if (record->event.pressed) {
8+
// Handle double tap and hold action for Esc key
9+
// For example, send Command + Space
10+
if (timer_elapsed(record->tap.last) < TAPPING_TERM) {
11+
// Double tap detected, send Command + Space
12+
SEND_STRING(SS_LGUI(" ") SS_DELAY(50));
13+
} else {
14+
// Hold action detected, do nothing or handle as needed
15+
}
16+
}
17+
break;
18+
// Add more custom keycode cases if needed
19+
}
20+
return true;
21+
}
22+
23+
// Function to define the tapping term for the custom keycode
24+
uint16_t get_tapping_term(uint16_t keycode, keyrecord_t *record) {
25+
switch (keycode) {
26+
case DOUBLE_ESC:
27+
return 150; // Adjust tapping term for double tap detection
28+
// Add more custom keycode cases if needed
29+
default:
30+
return TAPPING_TERM;
31+
}
32+
}

keyboards/vfk_001/keymaps/miryoku/custom_config.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ KC_F10, KC_F1, KC_F2, KC_F3, KC_P
8282
U_NP, U_NP, U_NA, KC_TAB, KC_SPC, U_NA, U_NA, U_NA, U_NP, U_NP
8383

8484
#define MIRYOKU_LAYER_MOUSE \
85-
TD(U_TD_BOOT), TD(U_TD_U_TAP), TD(U_TD_U_EXTRA), TD(U_TD_U_BASE), U_NA, LSFT(LCTL(KC_Z)), LCTL(KC_V), LCTL(KC_C), LCTL(KC_X), LCTL(KC_Z), \
85+
TD(U_TD_BOOT), TD(U_TD_U_TAP), TD(U_TD_U_EXTRA), TD(U_TD_U_BASE), U_NA, LSFT(LCMD(KC_Z)), LCMD(KC_V), LCMD(KC_C), LCMD(KC_X), LCMD(KC_Z), \
8686
KC_LGUI, KC_LALT, KC_LCTL, KC_LSFT, U_NA, KC_MS_L, KC_MS_D, KC_MS_U, KC_MS_R, U_NU, \
8787
U_NA, KC_RALT, TD(U_TD_U_SYM), TD(U_TD_U_MOUSE), U_NA, KC_WH_L, KC_WH_D, KC_WH_U, KC_WH_R, U_NU, \
8888
U_NP, U_NP, U_NA, U_NA, U_NA, KC_BTN2, KC_BTN1, KC_BTN3, U_NP, U_NP

0 commit comments

Comments
 (0)