diff --git a/compiler/template/zored_keymap.c b/compiler/template/zored_keymap.c index 6d43b2e..2d52e99 100644 --- a/compiler/template/zored_keymap.c +++ b/compiler/template/zored_keymap.c @@ -118,6 +118,7 @@ enum do_command { DO_ENPASS, DO_MAIL, DO_LOGIN, + DO_COPY, DO_PASTE, DO_TERMINAL, DO_SCREENSHOT, DO_BOOTLOADER, @@ -518,6 +519,26 @@ void run_advanced (uint8_t command) { break; } break; + case DO_COPY: + switch (zored_os) { + case OS_MACOS: + tap_code16(G(KC_C)); + break; + case OS_WINDOWS: + tap_code16(C(KC_C)); + break; + } + break; + case DO_PASTE: + switch (zored_os) { + case OS_MACOS: + tap_code16(G(KC_V)); + break; + case OS_WINDOWS: + tap_code16(C(KC_V)); + break; + } + break; case DO_BOOTLOADER: clear_keyboard(); bootloader_jump(); diff --git a/config.yaml b/config.yaml index 7ef6d06..ba6fa85 100644 --- a/config.yaml +++ b/config.yaml @@ -10,7 +10,7 @@ keyboards: - [esc, q, w, e, r, t, ~] - [capsDance, aDance, s, d, f, g] - ['shift(', zDance, xDance, cDance, v, b, doFutureApp] - - [leader, toggleNavigation, ~, doFutureTab, doPastTab] + - [leader, toggleNavigation, ~, doCopy, doPaste] left-thumb: - [esc, doOneShotTurbo] - [home] diff --git a/example/ergodox_ez/keymap.c b/example/ergodox_ez/keymap.c index 2ba1492..b988c06 100644 --- a/example/ergodox_ez/keymap.c +++ b/example/ergodox_ez/keymap.c @@ -14,8 +14,8 @@ enum custom_keycodes { ZKC_BTL = SAFE_RANGE, KC_DO_NEXT_LANGUAGE, KC_DO_FUTURE_APP, -KC_DO_FUTURE_TAB, -KC_DO_PAST_TAB, +KC_DO_COPY, +KC_DO_PASTE, KC_DO_ONE_SHOT_TURBO, KC_DO_PAST_APP, KC_DO_PAST_WINDOW, @@ -23,6 +23,8 @@ KC_DO_FUTURE_WINDOW, KC_DO_PAST, KC_DO_FUTURE, KC_DO_BOOTLOADER, +KC_DO_FUTURE_TAB, +KC_DO_PAST_TAB, // At the end: @@ -125,6 +127,7 @@ enum do_command { DO_ENPASS, DO_MAIL, DO_LOGIN, + DO_COPY, DO_PASTE, DO_TERMINAL, DO_SCREENSHOT, DO_BOOTLOADER, @@ -507,6 +510,26 @@ void run_advanced (uint8_t command) { break; } break; + case DO_COPY: + switch (zored_os) { + case OS_MACOS: + tap_code16(G(KC_C)); + break; + case OS_WINDOWS: + tap_code16(C(KC_C)); + break; + } + break; + case DO_PASTE: + switch (zored_os) { + case OS_MACOS: + tap_code16(G(KC_V)); + break; + case OS_WINDOWS: + tap_code16(C(KC_V)); + break; + } + break; case DO_BOOTLOADER: clear_keyboard(); bootloader_jump(); @@ -650,7 +673,7 @@ combo_t key_combos[COMBO_COUNT] = { }; -void process_combo_event(uint16_t combo_index, bool pressed) { +void process_combo_event(uint8_t combo_index, bool pressed) { if (!pressed) { return; } @@ -2502,7 +2525,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* left-1 */ KC_ESC,KC_Q,KC_W,KC_E,KC_R,KC_T,_______, /* left-2 */ TD(DANCE_KC_CAPSDANCE),TD(DANCE_KC_ADANCE),KC_S,KC_D,KC_F,KC_G, /* left-3 */ KC_LSPO,TD(DANCE_KC_ZDANCE),TD(DANCE_KC_XDANCE),TD(DANCE_KC_CDANCE),KC_V,KC_B,KC_DO_FUTURE_APP, -/* left-4 */ KC_LEAD,TG(LAYER_NAVIGATION),_______,KC_DO_FUTURE_TAB,KC_DO_PAST_TAB, +/* left-4 */ KC_LEAD,TG(LAYER_NAVIGATION),_______,KC_DO_COPY,KC_DO_PASTE, /* left-thumb-0 */ KC_ESC,KC_DO_ONE_SHOT_TURBO, /* left-thumb-1 */ KC_HOME, /* left-thumb-2 */ KC_SPC,KC_BSPC,KC_END, @@ -2788,12 +2811,12 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { run_advanced(DO_FUTURE_APP); break; - case KC_DO_FUTURE_TAB: - run_advanced(DO_FUTURE_TAB); + case KC_DO_COPY: + run_advanced(DO_COPY); break; - case KC_DO_PAST_TAB: - run_advanced(DO_PAST_TAB); + case KC_DO_PASTE: + run_advanced(DO_PASTE); break; case KC_DO_ONE_SHOT_TURBO: @@ -2824,6 +2847,14 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { run_advanced(DO_BOOTLOADER); break; + case KC_DO_FUTURE_TAB: + run_advanced(DO_FUTURE_TAB); + break; + + case KC_DO_PAST_TAB: + run_advanced(DO_PAST_TAB); + break; + default: return true; diff --git a/project.sh b/project.sh index 6ce7a47..f7f03ad 100755 --- a/project.sh +++ b/project.sh @@ -37,7 +37,11 @@ run () { if [[ "$OSTYPE" == "darwin"* ]]; then export OS=MACOSX - wally="/usr/local/bin/wally-cli" + if which wally-cli; then + wally="wally-cli" + else + wally="/usr/local/bin/wally-cli" + fi elif [[ "$OSTYPE" == "cygwin" ]] || [[ "$OSTYPE" == "msys" ]] || [[ "$OSTYPE" == "win32" ]]; then export OS=WINDOWS wally="'/c/Program Files (x86)/Wally/wally-cli.exe'" @@ -120,7 +124,8 @@ case $1 in if [[ "$OS" = 'MACOSX' ]]; then brew install libusb dfu-programmer fi - go build -o wally-cli cli/main.go + go install github.com/wailsapp/wails/cmd/wails@v1.16.6 + wails build ;; provision-host)