diff options
author | Joel Challis <git@zvecr.com> | 2023-11-26 18:36:45 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-27 05:36:45 +1100 |
commit | 1ed03f498fa204178c2696c510ac6a2cd8524e2d (patch) | |
tree | b97c1f983b7e4b57c007d0feedadd3ad3e39062b /users/imchipwood | |
parent | 4908d4b1ca260efecf3613e6517aa3a6f2034876 (diff) |
Remove userspace keymaps (#22544)
Diffstat (limited to 'users/imchipwood')
-rw-r--r-- | users/imchipwood/imchipwood.c | 141 | ||||
-rw-r--r-- | users/imchipwood/imchipwood.h | 51 | ||||
-rw-r--r-- | users/imchipwood/rules.mk | 2 |
3 files changed, 0 insertions, 194 deletions
diff --git a/users/imchipwood/imchipwood.c b/users/imchipwood/imchipwood.c deleted file mode 100644 index 9d111c015b..0000000000 --- a/users/imchipwood/imchipwood.c +++ /dev/null @@ -1,141 +0,0 @@ -/* Copyright 2021 imchipwood - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - */ -#include "imchipwood.h" - -static td_state_t td_state[3]; - -// determine the tapdance state to return -int cur_dance(tap_dance_state_t *state) { - if (state->count == 1) { - if (state->interrupted || !state->pressed) { - return SINGLE_TAP; - } else { - return SINGLE_HOLD; - } - } - if (state->count == 2) { - return DOUBLE_TAP; - } else { - return 3; - } // any number higher than the maximum state value you return above -} - -void altf2_finished(tap_dance_state_t *state, void *user_data) { - td_state[0] = cur_dance(state); - switch (td_state[0]) { - case SINGLE_TAP: - register_code(KC_F2); - break; - case SINGLE_HOLD: - register_mods(MOD_BIT(KC_LALT)); - break; - case DOUBLE_TAP: - register_mods(MOD_BIT(KC_LALT)); - tap_code(KC_F2); - break; - } -} - -void altf2_reset(tap_dance_state_t *state, void *user_data) { - switch (td_state[0]) { - case SINGLE_TAP: - unregister_code(KC_F2); - break; - case SINGLE_HOLD: - unregister_mods(MOD_BIT(KC_LALT)); - break; - case DOUBLE_TAP: - unregister_code(KC_F2); - unregister_mods(MOD_BIT(KC_LALT)); - break; - } -} - - -void ctlf5_finished(tap_dance_state_t *state, void *user_data) { - td_state[1] = cur_dance(state); - switch (td_state[1]) { - case SINGLE_TAP: - register_code(KC_F5); - break; - case SINGLE_HOLD: - register_mods(MOD_BIT(KC_LCTL)); - break; - case DOUBLE_TAP: - register_mods(MOD_BIT(KC_LCTL)); - tap_code(KC_F5); - break; - } -} - -void ctlf5_reset(tap_dance_state_t *state, void *user_data) { - switch (td_state[1]) { - case SINGLE_TAP: - unregister_code(KC_F5); - break; - case SINGLE_HOLD: - unregister_mods(MOD_BIT(KC_LCTL)); - break; - case DOUBLE_TAP: - unregister_code(KC_F5); - unregister_mods(MOD_BIT(KC_LCTL)); - break; - } -} - -void altf7_finished(tap_dance_state_t *state, void *user_data) { - td_state[2] = cur_dance(state); - switch (td_state[2]) { - case SINGLE_TAP: - register_code(KC_F7); - break; - case SINGLE_HOLD: - register_mods(MOD_BIT(KC_LALT)); - break; - case DOUBLE_TAP: - register_mods(MOD_BIT(KC_LALT)); - tap_code(KC_F7); - break; - } -} - -void altf7_reset(tap_dance_state_t *state, void *user_data) { - switch (td_state[2]) { - case SINGLE_TAP: - unregister_code(KC_F7); - break; - case SINGLE_HOLD: - unregister_mods(MOD_BIT(KC_LALT)); - break; - case DOUBLE_TAP: - unregister_code(KC_F7); - unregister_mods(MOD_BIT(KC_LALT)); - break; - } -} - -tap_dance_action_t tap_dance_actions[] = { - [ALT_F2] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, altf2_finished, altf2_reset), - [CTL_F5] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, ctlf5_finished, ctlf5_reset), - [ALT_F7] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, altf7_finished, altf7_reset), - [DEL_NLCK] = ACTION_TAP_DANCE_DOUBLE(KC_DEL, KC_NUM), - // Double tap right -> END - [TD_REND] = ACTION_TAP_DANCE_DOUBLE(KC_RIGHT, KC_END), - // Double tap left -> HOME - [TD_LOME] = ACTION_TAP_DANCE_DOUBLE(KC_LEFT, KC_HOME), - // Double tap right shift -> CAPS LOCK - [TD_RSFT_CAPS] = ACTION_TAP_DANCE_DOUBLE(KC_RSFT, KC_CAPS), -}; diff --git a/users/imchipwood/imchipwood.h b/users/imchipwood/imchipwood.h deleted file mode 100644 index 1e4bc3f744..0000000000 --- a/users/imchipwood/imchipwood.h +++ /dev/null @@ -1,51 +0,0 @@ -/* Copyright 2021 imchipwood - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - */ -#pragma once - -#include "quantum.h" - -// change the tapping term to a little bit quicker -#ifdef TAPPING_TERM - #undef TAPPING_TERM -#endif -#define TAPPING_TERM 175 - -#ifdef TAPPING_TOGGLE - #undef TAPPING_TOGGLE -#endif -#define TAPPING_TOGGLE 2 - - -enum td_keycodes { - TD_REND = 0, // right when tapped, end when double tapped - TD_LOME, // left when tapped, home when double tapped - TD_RSFT_CAPS, - ALT_F2, // F2 when tapped, LALT when held, LALT+F2 when double tapped - CTL_F5, // F5 when tapped, LCTL when held, LCTL+F5 when double tapped - ALT_F7, // F7 when tapped, LALT when held, LALT+F7 when double tapped - DEL_NLCK, // DEL when tapped, NUMLOCK when double tapped -}; - - -typedef enum { SINGLE_TAP, SINGLE_HOLD, DOUBLE_TAP } td_state_t; -int cur_dance(tap_dance_state_t *state); - -void altf2_finished(tap_dance_state_t *state, void *user_data); -void altf2_reset(tap_dance_state_t *state, void *user_data); -void ctlf5_finished(tap_dance_state_t *state, void *user_data); -void ctlf5_reset(tap_dance_state_t *state, void *user_data); -void altf7_finished(tap_dance_state_t *state, void *user_data); -void altf7_reset(tap_dance_state_t *state, void *user_data); diff --git a/users/imchipwood/rules.mk b/users/imchipwood/rules.mk deleted file mode 100644 index 87cca5b5e2..0000000000 --- a/users/imchipwood/rules.mk +++ /dev/null @@ -1,2 +0,0 @@ -SRC += imchipwood.c -TAP_DANCE_ENABLE=yes |