aboutsummaryrefslogtreecommitdiff
path: root/users/jdelkins/jdelkins.h
diff options
context:
space:
mode:
authorJoel Elkins <joel@elkins.co>2021-06-02 15:59:52 -0500
committerGitHub <noreply@github.com>2021-06-03 06:59:52 +1000
commit35dbe8ba035c8eefc1051226aa8e3dd7cd63a912 (patch)
treef152e98a0953238771853d1462a26e10d3540633 /users/jdelkins/jdelkins.h
parent93496c8364369f72e2db90c3c59dfa3ecc8657b4 (diff)
downloadqmk_firmware-35dbe8ba035c8eefc1051226aa8e3dd7cd63a912.tar.gz
qmk_firmware-35dbe8ba035c8eefc1051226aa8e3dd7cd63a912.zip
[Keymap] merge jdelkins userspace and associated keymaps (#11276)
* [Keymap] merge jdelkins userspace and associated keymaps * Add copyright & license info * Change rgblight_config.enable to rgblight_is_enabled() * Update keyboards/dz60/keymaps/jdelkins/keymap.c Co-authored-by: Drashna Jaelre <drashna@live.com> * Update keyboards/dz60/keymaps/jdelkins/keymap.c Co-authored-by: Drashna Jaelre <drashna@live.com> * Update keyboards/dz60/keymaps/jdelkins/keymap.c Co-authored-by: Drashna Jaelre <drashna@live.com> * Remove superfluous includes * Change EXTRAFLAGS+=-flto to LTO_ENABLE=yes * Remove unnecessary jdelkins_ss symlink in users * Add copyright and license notices * Use preferred way to determine capslock / numlock state Co-authored-by: Drashna Jaelre <drashna@live.com> * Add #pragma once to a header Co-authored-by: Drashna Jaelre <drashna@live.com> * Include QMK_KEYBOARD_H only once, in userspace header * Remove unnecessary initialization in matrix_init_keymap * Do process_record_keymap before cases handled in process_record_user * Reorganize & simplify secrets feature enablement * Use tap_code16 Co-authored-by: Ryan <fauxpark@gmail.com> * Remove superfluous break Co-authored-by: Ryan <fauxpark@gmail.com> * Remove copyright from rules.mk Co-authored-by: Ryan <fauxpark@gmail.com> * Remove copyright from rules.mk Co-authored-by: Ryan <fauxpark@gmail.com> * Use tap_code16 Co-authored-by: Ryan <fauxpark@gmail.com> * include "print.h" instead of <print.h> Co-authored-by: Ryan <fauxpark@gmail.com> * Use tap_cod16 Co-authored-by: Ryan <fauxpark@gmail.com> * Use tap_code16 Co-authored-by: Ryan <fauxpark@gmail.com> * Use tap_code16 Co-authored-by: Ryan <fauxpark@gmail.com> * Use tap_code16 Co-authored-by: Ryan <fauxpark@gmail.com> * Remove copyright from rules.mk Co-authored-by: Ryan <fauxpark@gmail.com> * add #pragma once to a header Co-authored-by: Ryan <fauxpark@gmail.com> * include "print.h" instead of <print.h> Co-authored-by: Ryan <fauxpark@gmail.com> * Remove copyright from rules.mk Co-authored-by: Ryan <fauxpark@gmail.com> * Remove copyright from rules.mk Co-authored-by: Ryan <fauxpark@gmail.com> * Remove copyright from rules.mk Co-authored-by: Ryan <fauxpark@gmail.com> * Use tap_code16 Co-authored-by: Ryan <fauxpark@gmail.com> * Use tap_code16 Co-authored-by: Ryan <fauxpark@gmail.com> * Use :flash target where possible * Remove special case flash target and use PROGRAM_CMD * dz60/jdelkins_ss: use tap_code16 Co-authored-by: Drashna Jaelre <drashna@live.com> Co-authored-by: Ryan <fauxpark@gmail.com>
Diffstat (limited to 'users/jdelkins/jdelkins.h')
-rw-r--r--users/jdelkins/jdelkins.h134
1 files changed, 134 insertions, 0 deletions
diff --git a/users/jdelkins/jdelkins.h b/users/jdelkins/jdelkins.h
new file mode 100644
index 000000000..ddec8dc4a
--- /dev/null
+++ b/users/jdelkins/jdelkins.h
@@ -0,0 +1,134 @@
1/*
2 Copyright 2020 Joel Elkins <joel@elkins.com>
3
4 This program is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation, either version 2 of the License, or
7 (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License
15 along with this program. If not, see <http://www.gnu.org/licenses/>.
16*/
17
18#pragma once
19
20#include QMK_KEYBOARD_H
21
22// Secrets
23
24#if !defined(NO_SECRETS) && __has_include("secrets.h")
25# define DO_SECRETS
26#endif
27
28void send_secret_string(uint8_t n);
29
30// standard layers
31
32enum jdelkins_layers {
33 _QWERTY = 0,
34 _RPT,
35 _GAME,
36 _FUNC,
37 _KP,
38 _SECRETS,
39 _ADJUST,
40 _LAYER_MAX
41};
42
43// key definitions
44
45typedef union {
46 uint32_t raw;
47 struct {
48 bool system_mac :1;
49 };
50} user_config_t;
51
52extern user_config_t user_config;
53
54static inline void do_mac_key(uint16_t norm_key, uint16_t mac_key, keyrecord_t *record) {
55 uint16_t key = user_config.system_mac ? mac_key : norm_key;
56 if (record->event.pressed)
57 register_code16(key);
58 else
59 unregister_code16(key);
60}
61
62enum jdelkins_keycodes {
63 KB_MAKE = SAFE_RANGE,
64 KB_FLSH,
65 KB_VRSN,
66 KB_BOOT,
67 FW_WRD,
68 BK_WRD,
69 KB_BOL,
70 KB_EOL,
71 TG_SYS,
72 KB_COPY,
73 KB_PASTE,
74 MY_GUI,
75 MY_ALT,
76 MY_RGUI,
77 MY_RALT,
78 MY_CALC,
79
80#ifdef DO_SECRETS
81 KC_SECRET_1,
82 KC_SECRET_2,
83 KC_SECRET_3,
84 KC_SECRET_4,
85 KC_SECRET_5,
86 KC_SECRET_6,
87#endif
88
89 USER_SAFE_RANGE,
90};
91
92#ifdef DO_SECRETS
93# define KC_SEC1 KC_SECRET_1
94# define KC_SEC2 KC_SECRET_2
95# define KC_SEC3 KC_SECRET_3
96# define KC_SEC4 KC_SECRET_4
97# define KC_SEC5 KC_SECRET_5
98# define KC_SEC6 KC_SECRET_6
99#else
100# define KC_SEC1 KC_NO
101# define KC_SEC2 KC_NO
102# define KC_SEC3 KC_NO
103# define KC_SEC4 KC_NO
104# define KC_SEC5 KC_NO
105# define KC_SEC6 KC_NO
106#endif
107
108#define MODS_SHIFT (get_mods() & MOD_MASK_SHIFT)
109#define MODS_CTRL (get_mods() & MOD_MASK_CTRL)
110#define MODS_ALT (get_mods() & MOD_MASK_ALT)
111#define MODS_GUI (get_mods() & MOD_MASK_GUI)
112
113#define MY_CAPS LCTL_T(KC_CAPS)
114#define MY_SPC LT(_FUNC, KC_SPC)
115
116#define NUMLOCK_ON host_keyboard_led_state().num_lock
117#define CAPSLOCK_ON host_keyboard_led_state().caps_lock
118
119#ifdef TAP_DANCE_ENABLE
120
121enum {
122 SINGLE_TAP = 1,
123 SINGLE_HOLD = 2,
124 DOUBLE_TAP = 3,
125 DOUBLE_HOLD = 4,
126 DOUBLE_SINGLE_TAP = 5, //send two single taps
127 TRIPLE_TAP = 6,
128 TRIPLE_HOLD = 7
129};
130
131int cur_dance(qk_tap_dance_state_t *state); // prefer tap
132int hold_cur_dance(qk_tap_dance_state_t *state); // prefer hold
133
134#endif // TAP_DANCE_ENABLE