diff options
author | InigoGutierrez <inigogf.95@gmail.com> | 2022-09-25 16:02:54 +0200 |
---|---|---|
committer | InigoGutierrez <inigogf.95@gmail.com> | 2022-09-25 16:02:54 +0200 |
commit | 6afdd9d74da250e47ac64d6690bd19d037045e99 (patch) | |
tree | 661f6cfb244c02bcd1fbfe8fb9b2bd9242a91394 /keyboards/spaceman/2_milk/keymaps | |
parent | 93a55e61b59d20f7cd842cce02e5b18a63a23612 (diff) | |
parent | 1bdf4cdc22ae57d111efb2f7d71e405e5c7b3f11 (diff) | |
download | qmk_firmware-6afdd9d74da250e47ac64d6690bd19d037045e99.tar.gz qmk_firmware-6afdd9d74da250e47ac64d6690bd19d037045e99.zip |
Merge branch 'master' into taamas
Diffstat (limited to 'keyboards/spaceman/2_milk/keymaps')
4 files changed, 84 insertions, 0 deletions
diff --git a/keyboards/spaceman/2_milk/keymaps/copypasta_macfancy/config.h b/keyboards/spaceman/2_milk/keymaps/copypasta_macfancy/config.h new file mode 100644 index 0000000000..bbd93cfc16 --- /dev/null +++ b/keyboards/spaceman/2_milk/keymaps/copypasta_macfancy/config.h @@ -0,0 +1,6 @@ +// Copyright 2022 Ryan Neff (@JellyTitan) +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#define TAPPING_TERM 200 diff --git a/keyboards/spaceman/2_milk/keymaps/copypasta_macfancy/keymap.c b/keyboards/spaceman/2_milk/keymaps/copypasta_macfancy/keymap.c new file mode 100644 index 0000000000..6f21c630bf --- /dev/null +++ b/keyboards/spaceman/2_milk/keymaps/copypasta_macfancy/keymap.c @@ -0,0 +1,56 @@ +// Copyright 2022 Ryan Neff (@JellyTitan) +// SPDX-License-Identifier: GPL-2.0-or-later + +#include QMK_KEYBOARD_H + +enum tapdance_keycodes { + TD_KEY_1, + TD_KEY_2 +}; + +void dance_key_one(qk_tap_dance_state_t *state, void *user_data) { + if (state->count == 1) { + /* Copy for Mac. */ + /* Windows & Linux use Ctrl+C: tap_code16(C(KC_C)) */ + tap_code16(G(KC_C)); + reset_tap_dance(state); + } else if (state->count == 2) { + /* Cut for Mac. */ + /* Windows & Linux use Ctrl+X: tap_code16(C(KC_X)) */ + tap_code16(G(KC_X)); + reset_tap_dance(state); + } else if (state->count == 3) { + /* Plain old Tab. */ + tap_code(KC_TAB); + reset_tap_dance(state); + } +} + +void dance_key_two(qk_tap_dance_state_t *state, void *user_data) { + if (state->count == 1) { + /* Paste for Mac. */ + /* Windows & Linux use Ctrl+V: tap_code16(C(KC_V)) */ + tap_code16(G(KC_V)); + reset_tap_dance(state); + } else if (state->count == 2) { + /* Paste as value Gui+Shift+V for Mac. */ + /* Windows & Linux use Ctrl+Shift V: tap_code16(C(S(KC_V))) */ + tap_code16(G(S(KC_V))); + reset_tap_dance(state); + } else if (state->count == 3) { + /* Tab between programs for mac Gui+Tab. */ + /* Windows & Linux use Ctrl+Tab: tap_code16(C(KC_TAB)) */ + tap_code16(G(KC_TAB)); + reset_tap_dance(state); + } +} + +qk_tap_dance_action_t tap_dance_actions[] = { + [TD_KEY_1] = ACTION_TAP_DANCE_FN(dance_key_one), + [TD_KEY_2] = ACTION_TAP_DANCE_FN(dance_key_two) +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT(TD(TD_KEY_1), + TD(TD_KEY_2)) +}; diff --git a/keyboards/spaceman/2_milk/keymaps/copypasta_macfancy/readme.md b/keyboards/spaceman/2_milk/keymaps/copypasta_macfancy/readme.md new file mode 100644 index 0000000000..722e7491bc --- /dev/null +++ b/keyboards/spaceman/2_milk/keymaps/copypasta_macfancy/readme.md @@ -0,0 +1,18 @@ +# Copypasta Macfancy Keymap for Milk 2% + +![copypasta_macfancy](https://i.imgur.com/7LMZZrL.png) + +Extra fancy copy/paste utilities for the Milk 2% keyboard on MacOS. Milk 2% designed by [Spaceman](https://github.com/Spaceboards/SpaceboardsHardware/tree/master/Keyboards/2%25%20Milk). + +Uses Tapping term for double and tripple tapping. +Tapping speed can be adjusted with TAPPING_TERM in config.h + +### Key One +- 1 Tap: Copy +- 2 Taps: Cut +- 3 Taps: Tab + +### Key Two +- 1 Tap: Paste +- 2 Taps: Paste as Value +- 3 Taps: Tab between programs diff --git a/keyboards/spaceman/2_milk/keymaps/copypasta_macfancy/rules.mk b/keyboards/spaceman/2_milk/keymaps/copypasta_macfancy/rules.mk new file mode 100644 index 0000000000..628a960a71 --- /dev/null +++ b/keyboards/spaceman/2_milk/keymaps/copypasta_macfancy/rules.mk @@ -0,0 +1,4 @@ +# Copyright 2022 Ryan Neff (@JellyTitan) +# SPDX-License-Identifier: GPL-2.0-or-later + +TAP_DANCE_ENABLE = yes # Tap Dance |