+void tap_dance_copy_paste_finished(qk_tap_dance_state_t *state, void *user_data) {
+ bool is_paste = state->count == 2;
+ // If either the one-shot shift is set, or if shift is being held, count as shift being held.
+ // We'll clear the one-shot shift if it was held
+ uint8_t one_shot_mods = get_oneshot_mods();
+ bool is_shift = false;
+
+ if (get_mods() & MOD_MASK_SHIFT) {
+ is_shift = true;
+ } else if (one_shot_mods & MOD_MASK_SHIFT) {
+ set_oneshot_mods(one_shot_mods & ~MOD_MASK_SHIFT);
+ is_shift = true;
+ }
+
+ if (is_paste) {
+ if (is_shift) {
+ SEND_STRING(SS_LSFT(SS_TAP(X_INSERT)));
+ } else {
+ SEND_STRING(SS_LCTRL("v"));
+ }
+ } else {
+ if (is_shift) {
+ SEND_STRING(SS_LCTRL(SS_TAP(X_INSERT)));
+ } else {
+ SEND_STRING(SS_LCTRL("c"));
+ }
+ }
+}
+