aboutsummaryrefslogtreecommitdiff
path: root/users/drashna
diff options
context:
space:
mode:
authorDrashna Jaelre <drashna@live.com>2018-11-26 16:45:24 -0800
committerMechMerlin <30334081+mechmerlin@users.noreply.github.com>2018-11-26 16:45:24 -0800
commitecd21b44a8efd5c7241ebf48c65fc7b30134865f (patch)
tree6fd84ca4bc241d9dbbe8ea3b81a7c8341b80ecc3 /users/drashna
parentedb6c98fd23ab102069037f3dbfbd46c6067e86a (diff)
downloadqmk_firmware-ecd21b44a8efd5c7241ebf48c65fc7b30134865f.tar.gz
qmk_firmware-ecd21b44a8efd5c7241ebf48c65fc7b30134865f.zip
Update to drashna userspace and keymaps (#4459)
* Fix reversed bool check in layer_state_set * Add Quefrency 65 for a friend * Add Ergodox EZ Glow keymap * Add RGB Matrix Code * Further changes to rgb matrix ErgoDox EZ * Update bjohnson keymaps * Fix CRKBD display * Overhaul to corne keyboard * Narrow scope for keylogger * Minor layout tweaks to Corne Keyboard * additional CRKBD tweaks * Minor tweaks to CRKBD * Add all characters for keylogger * Ergodox EZ Glow overhaul * Fix Ergodox EZ Glow layer colors * Increase Tapping Term for Corne Keyboard * Fix unicode-ish * Revert some changes * Add layer specific lighting effects * Some minor tweaks to ergodox glow config * revert changes to ergodox files * Update Glow readme * Add more tapping term defines * Fix changes * Fix ergodox keymap * Hopefully fix sleeping * Disable layer indications if rgb matrix is disabled * Add support for sleeping and rgb layer change toggle to ergodox ez glow * Make RGB Layer Indication Great Again * Make Unicode Great Again * Remove placeholder define Co-Authored-By: drashna <drashna@live.com> * Remove placeholder define Co-Authored-By: drashna <drashna@live.com> * Remove old EEPROM Reset keycode
Diffstat (limited to 'users/drashna')
-rw-r--r--users/drashna/config.h4
-rw-r--r--users/drashna/drashna.c22
-rw-r--r--users/drashna/drashna.h8
-rw-r--r--users/drashna/rgb_stuff.c86
-rw-r--r--users/drashna/rgb_stuff.h2
-rw-r--r--users/drashna/rules.mk17
-rw-r--r--users/drashna/send_unicode.c54
-rw-r--r--users/drashna/template.c7
-rw-r--r--users/drashna/template.h4
9 files changed, 154 insertions, 50 deletions
diff --git a/users/drashna/config.h b/users/drashna/config.h
index 7e6a7d1c8..06cae86ab 100644
--- a/users/drashna/config.h
+++ b/users/drashna/config.h
@@ -57,8 +57,10 @@
57#ifdef TAPPING_TERM 57#ifdef TAPPING_TERM
58#undef TAPPING_TERM 58#undef TAPPING_TERM
59#endif // TAPPING_TERM 59#endif // TAPPING_TERM
60#ifdef KEYBOARD_ergodox_ez 60#if defined(KEYBOARD_ergodox_ez)
61 #define TAPPING_TERM 185 61 #define TAPPING_TERM 185
62#elif defined(KEYBOARD_crkbd)
63 #define TAPPING_TERM 200
62#else 64#else
63 #define TAPPING_TERM 175 65 #define TAPPING_TERM 175
64#endif 66#endif
diff --git a/users/drashna/drashna.c b/users/drashna/drashna.c
index 4111d2931..8f10a530e 100644
--- a/users/drashna/drashna.c
+++ b/users/drashna/drashna.c
@@ -173,12 +173,15 @@ void matrix_init_user(void) {
173 get_unicode_input_mode(); 173 get_unicode_input_mode();
174 #endif //UNICODE_ENABLE 174 #endif //UNICODE_ENABLE
175 matrix_init_keymap(); 175 matrix_init_keymap();
176}
177
178void startup_user (void) {
179 #ifdef RGBLIGHT_ENABLE 176 #ifdef RGBLIGHT_ENABLE
180 matrix_init_rgb(); 177 matrix_init_rgb();
181 #endif //RGBLIGHT_ENABLE 178 #endif //RGBLIGHT_ENABLE
179}
180
181void startup_user (void) {
182 // #ifdef RGBLIGHT_ENABLE
183 // matrix_init_rgb();
184 // #endif //RGBLIGHT_ENABLE
182 startup_keymap(); 185 startup_keymap();
183} 186}
184 187
@@ -294,11 +297,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
294 } 297 }
295 break; 298 break;
296 299
297 case EPRM: // Resets EEPROM
298 if (record->event.pressed) {
299 eeconfig_init();
300 }
301 break;
302 case VRSN: // Prints firmware version 300 case VRSN: // Prints firmware version
303 if (record->event.pressed) { 301 if (record->event.pressed) {
304 send_string_with_delay_P(PSTR(QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION ", Built on: " QMK_BUILDDATE), MACRO_TIMER); 302 send_string_with_delay_P(PSTR(QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION ", Built on: " QMK_BUILDDATE), MACRO_TIMER);
@@ -392,7 +390,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
392#endif 390#endif
393 } 391 }
394 return process_record_keymap(keycode, record) && 392 return process_record_keymap(keycode, record) &&
395#ifdef RGBLIGHT_ENABLE 393#if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE)
396 process_record_user_rgb(keycode, record) && 394 process_record_user_rgb(keycode, record) &&
397#endif // RGBLIGHT_ENABLE 395#endif // RGBLIGHT_ENABLE
398 process_record_secrets(keycode, record); 396 process_record_secrets(keycode, record);
@@ -413,7 +411,11 @@ uint32_t layer_state_set_user(uint32_t state) {
413 411
414 412
415uint32_t default_layer_state_set_user(uint32_t state) { 413uint32_t default_layer_state_set_user(uint32_t state) {
416 return default_layer_state_set_keymap(state); 414 state = default_layer_state_set_keymap(state);
415#ifdef RGBLIGHT_ENABLE
416 state = default_layer_state_set_rgb(state);
417#endif // RGBLIGHT_ENABLE
418 return state;
417} 419}
418 420
419 421
diff --git a/users/drashna/drashna.h b/users/drashna/drashna.h
index 573cb26fd..06e726714 100644
--- a/users/drashna/drashna.h
+++ b/users/drashna/drashna.h
@@ -73,6 +73,8 @@ typedef union {
73 }; 73 };
74} userspace_config_t; 74} userspace_config_t;
75 75
76extern userspace_config_t userspace_config;
77
76#if defined(KEYMAP_SAFE_RANGE) 78#if defined(KEYMAP_SAFE_RANGE)
77 #define PLACEHOLDER_SAFE_RANGE KEYMAP_SAFE_RANGE 79 #define PLACEHOLDER_SAFE_RANGE KEYMAP_SAFE_RANGE
78#else 80#else
@@ -80,8 +82,7 @@ typedef union {
80#endif 82#endif
81 83
82enum userspace_custom_keycodes { 84enum userspace_custom_keycodes {
83 EPRM = PLACEHOLDER_SAFE_RANGE, // Resets EEPROM do defaults (as in eeconfig_init) 85 VRSN = PLACEHOLDER_SAFE_RANGE, // Prints QMK Firmware and board info
84 VRSN, // Prints QMK Firmware and board info
85 KC_QWERTY, // Sets default layer to QWERTY 86 KC_QWERTY, // Sets default layer to QWERTY
86 KC_COLEMAK, // Sets default layer to COLEMAK 87 KC_COLEMAK, // Sets default layer to COLEMAK
87 KC_DVORAK, // Sets default layer to DVORAK 88 KC_DVORAK, // Sets default layer to DVORAK
@@ -159,6 +160,9 @@ enum userspace_custom_keycodes {
159#define OS_RCTL OSM(MOD_RCTL) 160#define OS_RCTL OSM(MOD_RCTL)
160#define OS_LALT OSM(MOD_LALT) 161#define OS_LALT OSM(MOD_LALT)
161#define OS_RALT OSM(MOD_RALT) 162#define OS_RALT OSM(MOD_RALT)
163#define OS_MEH OSM(MOD_MEH)
164#define OS_HYPR OSM(MOD_HYPR)
165
162#define ALT_APP ALT_T(KC_APP) 166#define ALT_APP ALT_T(KC_APP)
163 167
164#define MG_NKRO MAGIC_TOGGLE_NKRO 168#define MG_NKRO MAGIC_TOGGLE_NKRO
diff --git a/users/drashna/rgb_stuff.c b/users/drashna/rgb_stuff.c
index b6de4d39e..d238c2065 100644
--- a/users/drashna/rgb_stuff.c
+++ b/users/drashna/rgb_stuff.c
@@ -2,8 +2,11 @@
2#include "rgb_stuff.h" 2#include "rgb_stuff.h"
3#include "eeprom.h" 3#include "eeprom.h"
4 4
5#if defined(RGBLIGHT_ENABLE)
5extern rgblight_config_t rgblight_config; 6extern rgblight_config_t rgblight_config;
6extern userspace_config_t userspace_config; 7#elif defined(RGB_MATRIX_ENABLE)
8extern rgb_config_t rgb_matrix_config;
9#endif
7 10
8#ifdef RGBLIGHT_ENABLE 11#ifdef RGBLIGHT_ENABLE
9void rgblight_sethsv_default_helper(uint8_t index) { 12void rgblight_sethsv_default_helper(uint8_t index) {
@@ -209,7 +212,7 @@ bool process_record_user_rgb(uint16_t keycode, keyrecord_t *record) {
209 return true; break; 212 return true; break;
210#endif // RGBLIGHT_TWINKLE 213#endif // RGBLIGHT_TWINKLE
211 case KC_RGB_T: // This allows me to use underglow as layer indication, or as normal 214 case KC_RGB_T: // This allows me to use underglow as layer indication, or as normal
212#ifdef RGBLIGHT_ENABLE 215#if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE)
213 if (record->event.pressed) { 216 if (record->event.pressed) {
214 userspace_config.rgb_layer_change ^= 1; 217 userspace_config.rgb_layer_change ^= 1;
215 xprintf("rgblight layer change [EEPROM]: %u\n", userspace_config.rgb_layer_change); 218 xprintf("rgblight layer change [EEPROM]: %u\n", userspace_config.rgb_layer_change);
@@ -237,24 +240,25 @@ bool process_record_user_rgb(uint16_t keycode, keyrecord_t *record) {
237 240
238 241
239 242
240void matrix_init_rgb(void) { 243 void matrix_init_rgb(void) {
241 244
242 if (userspace_config.rgb_layer_change) { 245// #ifdef RGBLIGHT_ENABLE
243 rgblight_init(); 246// if (userspace_config.rgb_layer_change) {
244 rgblight_enable_noeeprom(); 247// rgblight_enable_noeeprom();
245 switch (biton32(eeconfig_read_default_layer())) { 248// switch (biton32(eeconfig_read_default_layer())) {
246 case _COLEMAK: 249// case _COLEMAK:
247 rgblight_sethsv_noeeprom_magenta(); break; 250// rgblight_sethsv_noeeprom_magenta(); break;
248 case _DVORAK: 251// case _DVORAK:
249 rgblight_sethsv_noeeprom_springgreen(); break; 252// rgblight_sethsv_noeeprom_springgreen(); break;
250 case _WORKMAN: 253// case _WORKMAN:
251 rgblight_sethsv_noeeprom_goldenrod(); break; 254// rgblight_sethsv_noeeprom_goldenrod(); break;
252 default: 255// default:
253 rgblight_sethsv_noeeprom_cyan(); break; 256// rgblight_sethsv_noeeprom_cyan(); break;
254 } 257// }
255 rgblight_mode(RGBLIGHT_MODE_STATIC_LIGHT); 258// rgblight_mode(RGBLIGHT_MODE_STATIC_LIGHT);
256 } 259// }
257} 260// #endif
261 }
258 262
259void matrix_scan_rgb(void) { 263void matrix_scan_rgb(void) {
260#ifdef RGBLIGHT_TWINKLE 264#ifdef RGBLIGHT_TWINKLE
@@ -270,7 +274,6 @@ void matrix_scan_rgb(void) {
270 274
271uint32_t layer_state_set_rgb(uint32_t state) { 275uint32_t layer_state_set_rgb(uint32_t state) {
272#ifdef RGBLIGHT_ENABLE 276#ifdef RGBLIGHT_ENABLE
273 static bool has_ran;
274 if (userspace_config.rgb_layer_change) { 277 if (userspace_config.rgb_layer_change) {
275 switch (biton32(state)) { 278 switch (biton32(state)) {
276 case _MACROS: 279 case _MACROS:
@@ -312,12 +315,7 @@ uint32_t layer_state_set_rgb(uint32_t state) {
312 default: 315 default:
313 rgblight_sethsv_noeeprom_cyan(); break; 316 rgblight_sethsv_noeeprom_cyan(); break;
314 } 317 }
315 if (has_ran) { 318 biton32(state) == _MODS ? rgblight_mode_noeeprom(RGBLIGHT_MODE_BREATHING) : rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT); // if _MODS layer is on, then breath to denote it
316 biton32(state) == _MODS ? rgblight_mode(RGBLIGHT_MODE_BREATHING) : rgblight_mode(RGBLIGHT_MODE_STATIC_LIGHT); // if _MODS layer is on, then breath to denote it
317 } else {
318 biton32(state) == _MODS ? rgblight_mode_noeeprom(RGBLIGHT_MODE_BREATHING) : rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT); // if _MODS layer is on, then breath to denote it
319 has_ran = true;
320 }
321 break; 319 break;
322 } 320 }
323// layer_state_set_indicator(); // Runs every scan, so need to call this here .... since I can't get it working "right" anyhow 321// layer_state_set_indicator(); // Runs every scan, so need to call this here .... since I can't get it working "right" anyhow
@@ -326,3 +324,39 @@ uint32_t layer_state_set_rgb(uint32_t state) {
326 324
327 return state; 325 return state;
328} 326}
327
328uint32_t default_layer_state_set_rgb(uint32_t state) {
329#ifdef RGBLIGHT_ENABLE
330 if (userspace_config.rgb_layer_change) {
331 rgblight_config_t temp_rgblight_config = rgblight_config;
332 switch (biton32(state)) {
333 case _COLEMAK:
334 temp_rgblight_config.hue = 300;
335 temp_rgblight_config.val = 255;
336 temp_rgblight_config.sat = 255;
337 temp_rgblight_config.mode = 1;
338 break;
339 case _DVORAK:
340 temp_rgblight_config.hue = 150;
341 temp_rgblight_config.val = 255;
342 temp_rgblight_config.sat = 255;
343 temp_rgblight_config.mode = 1;
344 case _WORKMAN:
345 temp_rgblight_config.hue = 43;
346 temp_rgblight_config.val = 218;
347 temp_rgblight_config.sat = 218;
348 temp_rgblight_config.mode = 1;
349 default:
350 temp_rgblight_config.hue = 180;
351 temp_rgblight_config.val = 255;
352 temp_rgblight_config.sat = 255;
353 temp_rgblight_config.mode = 1;
354 }
355 if (temp_rgblight_config.raw != eeconfig_read_rgblight()) {
356 xprintf("rgblight set default layer hsv [EEPROM]: %u,%u,%u,%u\n", temp_rgblight_config.hue, temp_rgblight_config.sat, temp_rgblight_config.val, temp_rgblight_config.mode);
357 eeconfig_update_rgblight(temp_rgblight_config.raw);
358 }
359 }
360#endif // RGBLIGHT_ENABLE
361 return state;
362}
diff --git a/users/drashna/rgb_stuff.h b/users/drashna/rgb_stuff.h
index 50c75c8c3..3db068a31 100644
--- a/users/drashna/rgb_stuff.h
+++ b/users/drashna/rgb_stuff.h
@@ -12,4 +12,4 @@ void scan_rgblight_fadeout(void);
12void matrix_init_rgb(void); 12void matrix_init_rgb(void);
13void matrix_scan_rgb(void); 13void matrix_scan_rgb(void);
14uint32_t layer_state_set_rgb(uint32_t state); 14uint32_t layer_state_set_rgb(uint32_t state);
15 15uint32_t default_layer_state_set_rgb(uint32_t state);
diff --git a/users/drashna/rules.mk b/users/drashna/rules.mk
index 964c96c52..49b1ddae9 100644
--- a/users/drashna/rules.mk
+++ b/users/drashna/rules.mk
@@ -27,6 +27,11 @@ ifeq ($(strip $(RGBLIGHT_ENABLE)), yes)
27 endif 27 endif
28endif 28endif
29 29
30ifeq ($(strip $(RGB_MATRIX_ENABLE)), yes)
31 SRC += rgb_stuff.c
32endif
33
34
30ifeq ($(strip $(MACROS_ENABLED)), yes) 35ifeq ($(strip $(MACROS_ENABLED)), yes)
31 OPT_DEFS += -DMACROS_ENABLED 36 OPT_DEFS += -DMACROS_ENABLED
32endif 37endif
@@ -37,3 +42,15 @@ ifdef CONSOLE_ENABLE
37 endif 42 endif
38endif 43endif
39 44
45
46ifeq ($(strip $(UCIS_ENABLE)), yes)
47 SRC += send_unicode.c
48endif
49
50ifeq ($(strip $(UNICODEMAP_ENABLE)), yes)
51 SRC += send_unicode.c
52endif
53
54ifeq ($(strip $(UNICODE_ENABLE)), yes)
55 SRC += send_unicode.c
56endif
diff --git a/users/drashna/send_unicode.c b/users/drashna/send_unicode.c
index cacfe1dc8..ff35368da 100644
--- a/users/drashna/send_unicode.c
+++ b/users/drashna/send_unicode.c
@@ -56,3 +56,57 @@ void send_unicode_hex_string(const char* str) {
56 56
57 57
58// If you need a good converter: https://r12a.github.io/app-conversion/ 58// If you need a good converter: https://r12a.github.io/app-conversion/
59uint8_t saved_mods;
60
61void unicode_input_start (void) {
62 // save current mods
63 saved_mods = get_mods(); // Save current mods
64 clear_mods(); // Unregister mods to start from a clean state
65
66 switch(get_unicode_input_mode()) {
67 case UC_OSX:
68 register_code(KC_LALT);
69 break;
70 case UC_OSX_RALT:
71 register_code(KC_RALT);
72 break;
73 case UC_LNX:
74 register_code(KC_LCTL);
75 register_code(KC_LSFT);
76 register_code(KC_U);
77 unregister_code(KC_U);
78 unregister_code(KC_LSFT);
79 unregister_code(KC_LCTL);
80 break;
81 case UC_WIN:
82 register_code(KC_LALT);
83 register_code(KC_PPLS);
84 unregister_code(KC_PPLS);
85 break;
86 case UC_WINC:
87 register_code(KC_RALT);
88 unregister_code(KC_RALT);
89 register_code(KC_U);
90 unregister_code(KC_U);
91 break;
92 }
93 wait_ms(UNICODE_TYPE_DELAY);
94}
95
96void unicode_input_finish (void) {
97 switch(get_unicode_input_mode()) {
98 case UC_OSX:
99 case UC_WIN:
100 unregister_code(KC_LALT);
101 break;
102 case UC_OSX_RALT:
103 unregister_code(KC_RALT);
104 break;
105 case UC_LNX:
106 register_code(KC_SPC);
107 unregister_code(KC_SPC);
108 break;
109 }
110
111 set_mods(saved_mods); // Reregister previously set mods
112}
diff --git a/users/drashna/template.c b/users/drashna/template.c
index e6b50c961..0e188f3a5 100644
--- a/users/drashna/template.c
+++ b/users/drashna/template.c
@@ -50,12 +50,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
50 return false; 50 return false;
51 break; 51 break;
52 52
53 case EPRM:
54 if (record->event.pressed) {
55 eeconfig_init();
56 }
57 return false;
58 break;
59 case VRSN: 53 case VRSN:
60 if (record->event.pressed) { 54 if (record->event.pressed) {
61 SEND_STRING(QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION); 55 SEND_STRING(QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION);
@@ -128,4 +122,3 @@ void shutdown_keymap(void) {}
128void shutdown_user (void) { 122void shutdown_user (void) {
129 shutdown_keymap(); 123 shutdown_keymap();
130} 124}
131
diff --git a/users/drashna/template.h b/users/drashna/template.h
index 5b3a93de5..dd1c48760 100644
--- a/users/drashna/template.h
+++ b/users/drashna/template.h
@@ -9,9 +9,7 @@
9#define BASE 0 9#define BASE 0
10 10
11enum custom_keycodes { 11enum custom_keycodes {
12 PLACEHOLDER = SAFE_RANGE, // can always be here 12 VRSN = SAFE_RANGE, // can always be here
13 EPRM,
14 VRSN,
15 KC_MAKE, 13 KC_MAKE,
16 KC_RESET, 14 KC_RESET,
17 NEWPLACEHOLDER //use "NEWPLACEHOLDER for keymap specific codes 15 NEWPLACEHOLDER //use "NEWPLACEHOLDER for keymap specific codes