summaryrefslogtreecommitdiff
path: root/users/hvp/tap_dances.c
diff options
context:
space:
mode:
authorhvp <32483282+hvpkod@users.noreply.github.com>2019-10-16 19:44:43 +0200
committerDrashna Jaelre <drashna@live.com>2019-10-16 10:44:43 -0700
commit162dd3fe19a9c3bf15d63013bf51a49877de0bc9 (patch)
treed9d955472b8a266d1faa94eb95686c8b0c07dd4f /users/hvp/tap_dances.c
parent9b07098dbd63fcd7b69eadfa91b5b01724e80e78 (diff)
[Keymap] Corne keyap with tap dance Swedish support (#6857)
* Adding profile for Corne with tap dance Swedish support. * Remove extern keymap_config_t keymap_config as no longer needed * Changed to use tap_code over register_code * Removed persistent_default_layer_set * Moved macros to hvp user space ink tap dance code * Removed not used functions * Moved to an ifbased include statement * Removed not needed characters
Diffstat (limited to 'users/hvp/tap_dances.c')
-rw-r--r--users/hvp/tap_dances.c75
1 files changed, 75 insertions, 0 deletions
diff --git a/users/hvp/tap_dances.c b/users/hvp/tap_dances.c
new file mode 100644
index 0000000000..bb102b30ab
--- /dev/null
+++ b/users/hvp/tap_dances.c
@@ -0,0 +1,75 @@
+#include "tap_dances.h"
+
+// Tap dance function for enable swedish characters on first layer. Unregister to not let tap bleed over to next keypress.
+// Tap dance 1
+void dance_1_finished(qk_tap_dance_state_t *state, void *user_data) {
+ if (state->count == 2) {
+ tap_code(KC_SCLN);
+ } else {
+ register_code(KC_RALT);
+ register_code(KC_O);
+ unregister_code(KC_RALT);
+ unregister_code(KC_O);
+ }
+}
+
+void dance_1_reset(qk_tap_dance_state_t *state, void *user_data) {
+ if (state->count == 2) {
+ unregister_code(KC_SCLN);
+ } else {
+ unregister_code(KC_RALT);
+ unregister_code(KC_O);
+ }
+}
+
+// Tap dance 2
+void dance_2_finished(qk_tap_dance_state_t *state, void *user_data) {
+ if (state->count == 2) {
+ tap_code(KC_QUOT);
+ } else {
+ register_code(KC_RALT);
+ register_code(KC_A);
+ unregister_code(KC_RALT);
+ unregister_code(KC_A);
+ }
+}
+
+void dance_2_reset(qk_tap_dance_state_t *state, void *user_data) {
+ if (state->count == 2) {
+ unregister_code(KC_QUOT);
+ } else {
+ unregister_code(KC_RALT);
+ unregister_code(KC_A);
+ }
+}
+
+// Tap dance 3
+void dance_3_finished(qk_tap_dance_state_t *state, void *user_data) {
+ // if (state->count == 2)
+ if (state->count == 2) {
+ tap_code(KC_SLSH);
+ } else {
+ register_code(KC_RALT);
+ register_code(KC_W);
+ unregister_code(KC_RALT);
+ unregister_code(KC_W);
+ }
+}
+
+void dance_3_reset(qk_tap_dance_state_t *state, void *user_data) {
+ if (state->count == 2) {
+ unregister_code(KC_SLSH);
+ } else {
+ unregister_code(KC_RALT);
+ unregister_code(KC_W);
+ }
+}
+
+// Tap Dance Definitions
+qk_tap_dance_action_t tap_dance_actions[] = {
+ // simple tap dance
+ [TD1] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, dance_1_finished, dance_1_reset),
+
+ [TD2] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, dance_2_finished, dance_2_reset),
+
+ [TD3] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, dance_3_finished, dance_3_reset)}; \ No newline at end of file