aboutsummaryrefslogtreecommitdiff
path: root/users/billypython
diff options
context:
space:
mode:
authorDanilo Vulicevic <danilo.vulicevic@yahoo.com>2019-02-14 21:09:27 +0100
committerDrashna Jaelre <drashna@live.com>2019-02-14 12:09:27 -0800
commit1e6797b4e7d888f0c0449e3cd577dc83eb4c4525 (patch)
tree054868cb8b176df99abdb91b3893e241727eaaf5 /users/billypython
parentce465c084bfdfb3dbd24414397b2542176da423d (diff)
downloadqmk_firmware-1e6797b4e7d888f0c0449e3cd577dc83eb4c4525.tar.gz
qmk_firmware-1e6797b4e7d888f0c0449e3cd577dc83eb4c4525.zip
[Keymap] Add my personal userspace and update my keymaps (#5128)
* Add billypython userspace and dz60 keymap * Disable Bootmagic in dz60:billypython keymap * Update whitefox:billypython keymap with userspace changes Also remove numpad layer
Diffstat (limited to 'users/billypython')
-rw-r--r--users/billypython/billypython.c32
-rw-r--r--users/billypython/billypython.h34
-rw-r--r--users/billypython/config.h19
-rw-r--r--users/billypython/rules.mk6
-rw-r--r--users/billypython/tap_dance.c33
-rw-r--r--users/billypython/tap_dance.h9
6 files changed, 133 insertions, 0 deletions
diff --git a/users/billypython/billypython.c b/users/billypython/billypython.c
new file mode 100644
index 000000000..7bdfe33a4
--- /dev/null
+++ b/users/billypython/billypython.c
@@ -0,0 +1,32 @@
1#include "billypython.h"
2
3__attribute__((weak))
4bool process_record_keymap(uint16_t keycode, keyrecord_t *record) {
5 return true;
6}
7
8bool process_record_user(uint16_t keycode, keyrecord_t *record) {
9 if (!process_record_keymap(keycode, record)) {
10 return false;
11 }
12
13 switch (keycode) {
14 case CLEAR:
15 if (record->event.pressed) {
16 SEND_STRING(SS_LCTRL("a") SS_TAP(X_DELETE));
17 }
18 return false;
19
20 default:
21 return true;
22 }
23}
24
25__attribute__((weak))
26uint32_t layer_state_set_keymap(uint32_t state) {
27 return state;
28}
29
30uint32_t layer_state_set_user(uint32_t state) {
31 return layer_state_set_keymap(state);
32}
diff --git a/users/billypython/billypython.h b/users/billypython/billypython.h
new file mode 100644
index 000000000..4a444e978
--- /dev/null
+++ b/users/billypython/billypython.h
@@ -0,0 +1,34 @@
1#pragma once
2
3#include "quantum.h"
4
5#ifdef TAP_DANCE_ENABLE
6 #include "tap_dance.h"
7#endif
8
9#ifdef LAYER_FN
10 #define FN MO(L_FN)
11 #define FN_CAPS LT(L_FN, KC_CAPS)
12 #define FN_FNLK TT(L_FN)
13#endif
14
15#define TOP LCTL(KC_HOME)
16#define BOTTOM LCTL(KC_END)
17
18enum keycodes_user {
19 CLEAR = SAFE_RANGE,
20
21 RANGE_KEYMAP,
22};
23
24enum layers_user {
25 L_BASE,
26#ifdef LAYER_FN
27 L_FN,
28#endif
29
30 L_RANGE_KEYMAP,
31};
32
33bool process_record_keymap(uint16_t keycode, keyrecord_t *record);
34uint32_t layer_state_set_keymap(uint32_t state);
diff --git a/users/billypython/config.h b/users/billypython/config.h
new file mode 100644
index 000000000..705e6c934
--- /dev/null
+++ b/users/billypython/config.h
@@ -0,0 +1,19 @@
1#pragma once
2
3#define FORCE_NKRO
4
5#define MAGIC_KEY_BOOTLOADER B
6
7#define MOUSEKEY_DELAY 50
8#define MOUSEKEY_INTERVAL 15
9#define MOUSEKEY_MAX_SPEED 4
10#define MOUSEKEY_TIME_TO_MAX 50
11#define MOUSEKEY_WHEEL_MAX_SPEED 1
12#define MOUSEKEY_WHEEL_TIME_TO_MAX 50
13
14#define NO_ACTION_FUNCTION
15#define NO_ACTION_MACRO
16
17#define PERMISSIVE_HOLD
18#define TAPPING_TERM 200
19#define TAPPING_TOGGLE 2
diff --git a/users/billypython/rules.mk b/users/billypython/rules.mk
new file mode 100644
index 000000000..915323b49
--- /dev/null
+++ b/users/billypython/rules.mk
@@ -0,0 +1,6 @@
1SRC += billypython.c
2ifeq ($(strip $(TAP_DANCE_ENABLE)), yes)
3 SRC += tap_dance.c
4endif
5
6EXTRAFLAGS += -flto
diff --git a/users/billypython/tap_dance.c b/users/billypython/tap_dance.c
new file mode 100644
index 000000000..74ae16639
--- /dev/null
+++ b/users/billypython/tap_dance.c
@@ -0,0 +1,33 @@
1#include "tap_dance.h"
2
3#define ACTION_TAP_DANCE_DOUBLE_MODS(mod1, mod2) { \
4 .fn = { td_double_mods_each, NULL, td_double_mods_reset }, \
5 .user_data = &(qk_tap_dance_pair_t){ mod1, mod2 }, \
6 }
7
8void td_double_mods_each(qk_tap_dance_state_t *state, void *user_data) {
9 qk_tap_dance_pair_t *mods = (qk_tap_dance_pair_t *)user_data;
10 // Single tap → mod1, double tap → mod2, triple tap etc. → mod1+mod2
11 if (state->count == 1 || state->count == 3) {
12 register_code(mods->kc1);
13 } else if (state->count == 2) {
14 unregister_code(mods->kc1);
15 register_code(mods->kc2);
16 }
17 // Prevent tap dance from sending kc1 and kc2 as weak mods
18 state->weak_mods &= ~(MOD_BIT(mods->kc1) | MOD_BIT(mods->kc2));
19}
20
21void td_double_mods_reset(qk_tap_dance_state_t *state, void *user_data) {
22 qk_tap_dance_pair_t *mods = (qk_tap_dance_pair_t *)user_data;
23 if (state->count == 1 || state->count >= 3) {
24 unregister_code(mods->kc1);
25 }
26 if (state->count >= 2) {
27 unregister_code(mods->kc2);
28 }
29}
30
31qk_tap_dance_action_t tap_dance_actions[] = {
32 [TD_RSF_RCT] = ACTION_TAP_DANCE_DOUBLE_MODS(KC_RSFT, KC_RCTL),
33};
diff --git a/users/billypython/tap_dance.h b/users/billypython/tap_dance.h
new file mode 100644
index 000000000..258198141
--- /dev/null
+++ b/users/billypython/tap_dance.h
@@ -0,0 +1,9 @@
1#pragma once
2
3#include "quantum.h"
4
5#define RSF_RCT TD(TD_RSF_RCT)
6
7enum tap_dance {
8 TD_RSF_RCT,
9};