aboutsummaryrefslogtreecommitdiff
path: root/users/muppetjones/features/dancelayers.c
diff options
context:
space:
mode:
authorNick Brassel <[email protected]>2023-11-28 16:39:48 +1100
committerNick Brassel <[email protected]>2023-11-28 16:40:47 +1100
commit0115951de12bd4c798a43a380651c34552552e85 (patch)
tree62999011ae782d93aa6dc9c889615db2a840cafc /users/muppetjones/features/dancelayers.c
parent0379d1f59e58cefa18cdb72ba1b77507d1108ae6 (diff)
parent4d99e0a23cff02f4c6e55e093b5de08a9be0df7c (diff)
downloadqmk_firmware-0115951de12bd4c798a43a380651c34552552e85.tar.gz
qmk_firmware-0115951de12bd4c798a43a380651c34552552e85.zip
`develop` -> `master`, 2023q4 edition0.23.0
Diffstat (limited to 'users/muppetjones/features/dancelayers.c')
-rw-r--r--users/muppetjones/features/dancelayers.c98
1 files changed, 0 insertions, 98 deletions
diff --git a/users/muppetjones/features/dancelayers.c b/users/muppetjones/features/dancelayers.c
deleted file mode 100644
index 3744950a4f..0000000000
--- a/users/muppetjones/features/dancelayers.c
+++ /dev/null
@@ -1,98 +0,0 @@
-/* Copyright 2020 Stephen J. Bush
- *
- * 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/>.
- */
-
-#ifdef TAP_DANCE_ENABLE
-
-# include QMK_KEYBOARD_H
-# include "muppetjones.h"
-# include "dancelayers.h"
-
-// Initialize tap structure associated with example tap dance key
-static td_tap_t lyr_tap_state = {.is_press_action = true, .state = TD_NONE};
-
-/* @brief Determine the current tap dance state
- * @param A tap dance state struct.
- * @return A struct.
- */
-td_state_t cur_dance(tap_dance_state_t *state) {
- switch (state->count) {
- case 1:
- if (!state->pressed)
- return TD_1X_TAP;
- else
- return TD_1X_HOLD;
- case 2:
- return TD_2X_TAP;
- break;
- case 3:
- return TD_3X_TAP;
- break;
- case 4:
- return TD_4X_TAP;
- break;
- default:
- return TD_UNKNOWN;
- }
-}
-
-// Functions that control what our tap dance key does
-__attribute__((weak)) void td_layer_finished(tap_dance_state_t *state, void *user_data) {
- lyr_tap_state.state = cur_dance(state);
- switch (lyr_tap_state.state) {
- case TD_1X_TAP:
- if (layer_state_is(_MOUSE))
- layer_off(_MOUSE);
- else
- layer_on(_MOUSE);
- break;
- case TD_1X_HOLD:
- layer_on(_ADJUST);
- break;
- case TD_2X_TAP:
- // Toggle lower layer
- if (layer_state_is(_LOWER))
- layer_off(_LOWER);
- else
- layer_on(_LOWER);
- break;
- case TD_3X_TAP:
- // Toggle lower layer
- if (layer_state_is(_RAISE))
- layer_off(_RAISE);
- else
- layer_on(_RAISE);
- break;
- case TD_4X_TAP:
- // Toggle lower layer
- if (layer_state_is(_ADJUST))
- layer_off(_ADJUST);
- else
- layer_on(_ADJUST);
- break;
- default:
- break;
- }
-}
-
-__attribute__((weak)) void td_layer_reset(tap_dance_state_t *state, void *user_data) {
- // If the key was held down and now is released then switch off the layer
- if (lyr_tap_state.state == TD_1X_HOLD) {
- layer_off(_ADJUST);
- }
- lyr_tap_state.state = TD_NONE;
-}
-
-#endif