aboutsummaryrefslogtreecommitdiff
path: root/users/hvp
diff options
context:
space:
mode:
Diffstat (limited to 'users/hvp')
-rw-r--r--users/hvp/hvp.c2
-rw-r--r--users/hvp/hvp.h6
-rw-r--r--users/hvp/readme.md1
-rw-r--r--users/hvp/rules.mk4
-rw-r--r--users/hvp/tap_dances.c75
-rw-r--r--users/hvp/tap_dances.h10
6 files changed, 98 insertions, 0 deletions
diff --git a/users/hvp/hvp.c b/users/hvp/hvp.c
new file mode 100644
index 000000000..7e484535c
--- /dev/null
+++ b/users/hvp/hvp.c
@@ -0,0 +1,2 @@
1
2#include "hvp.h"
diff --git a/users/hvp/hvp.h b/users/hvp/hvp.h
new file mode 100644
index 000000000..2b2210f87
--- /dev/null
+++ b/users/hvp/hvp.h
@@ -0,0 +1,6 @@
1#pragma once
2
3#ifdef TAP_DANCE_ENABLE
4# include "tap_dances.h"
5#endif
6#include "quantum.h"
diff --git a/users/hvp/readme.md b/users/hvp/readme.md
new file mode 100644
index 000000000..2d8f9d859
--- /dev/null
+++ b/users/hvp/readme.md
@@ -0,0 +1 @@
Personal user space for hvpcode / cablegore at discord
diff --git a/users/hvp/rules.mk b/users/hvp/rules.mk
new file mode 100644
index 000000000..0a7e67963
--- /dev/null
+++ b/users/hvp/rules.mk
@@ -0,0 +1,4 @@
1SRC += hvp.c
2ifeq ($(strip $(TAP_DANCE_ENABLE)), yes)
3 SRC += tap_dances.c
4endif \ No newline at end of file
diff --git a/users/hvp/tap_dances.c b/users/hvp/tap_dances.c
new file mode 100644
index 000000000..bb102b30a
--- /dev/null
+++ b/users/hvp/tap_dances.c
@@ -0,0 +1,75 @@
1#include "tap_dances.h"
2
3// Tap dance function for enable swedish characters on first layer. Unregister to not let tap bleed over to next keypress.
4// Tap dance 1
5void dance_1_finished(qk_tap_dance_state_t *state, void *user_data) {
6 if (state->count == 2) {
7 tap_code(KC_SCLN);
8 } else {
9 register_code(KC_RALT);
10 register_code(KC_O);
11 unregister_code(KC_RALT);
12 unregister_code(KC_O);
13 }
14}
15
16void dance_1_reset(qk_tap_dance_state_t *state, void *user_data) {
17 if (state->count == 2) {
18 unregister_code(KC_SCLN);
19 } else {
20 unregister_code(KC_RALT);
21 unregister_code(KC_O);
22 }
23}
24
25// Tap dance 2
26void dance_2_finished(qk_tap_dance_state_t *state, void *user_data) {
27 if (state->count == 2) {
28 tap_code(KC_QUOT);
29 } else {
30 register_code(KC_RALT);
31 register_code(KC_A);
32 unregister_code(KC_RALT);
33 unregister_code(KC_A);
34 }
35}
36
37void dance_2_reset(qk_tap_dance_state_t *state, void *user_data) {
38 if (state->count == 2) {
39 unregister_code(KC_QUOT);
40 } else {
41 unregister_code(KC_RALT);
42 unregister_code(KC_A);
43 }
44}
45
46// Tap dance 3
47void dance_3_finished(qk_tap_dance_state_t *state, void *user_data) {
48 // if (state->count == 2)
49 if (state->count == 2) {
50 tap_code(KC_SLSH);
51 } else {
52 register_code(KC_RALT);
53 register_code(KC_W);
54 unregister_code(KC_RALT);
55 unregister_code(KC_W);
56 }
57}
58
59void dance_3_reset(qk_tap_dance_state_t *state, void *user_data) {
60 if (state->count == 2) {
61 unregister_code(KC_SLSH);
62 } else {
63 unregister_code(KC_RALT);
64 unregister_code(KC_W);
65 }
66}
67
68// Tap Dance Definitions
69qk_tap_dance_action_t tap_dance_actions[] = {
70 // simple tap dance
71 [TD1] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, dance_1_finished, dance_1_reset),
72
73 [TD2] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, dance_2_finished, dance_2_reset),
74
75 [TD3] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, dance_3_finished, dance_3_reset)}; \ No newline at end of file
diff --git a/users/hvp/tap_dances.h b/users/hvp/tap_dances.h
new file mode 100644
index 000000000..705985faa
--- /dev/null
+++ b/users/hvp/tap_dances.h
@@ -0,0 +1,10 @@
1#pragma once
2#include "hvp.h"
3
4// Tap Dance Declarations
5enum tapdance_id
6{
7 TD1 = 0,
8 TD2,
9 TD3
10};