diff options
| author | Jonas Avellana <14019120+ninjonas@users.noreply.github.com> | 2019-09-30 11:50:27 -0600 |
|---|---|---|
| committer | Drashna Jaelre <drashna@live.com> | 2019-09-30 10:50:27 -0700 |
| commit | cffe671a61e8187b39a508556c7a5b5f04835d24 (patch) | |
| tree | 071199e57f8c1db1c18af28aa19dda78595a1c67 /users/ninjonas | |
| parent | f418efcaf5d681e87bd23b4d28621b87ff61fcb9 (diff) | |
| download | qmk_firmware-cffe671a61e8187b39a508556c7a5b5f04835d24.tar.gz qmk_firmware-cffe671a61e8187b39a508556c7a5b5f04835d24.zip | |
[Keymap] Updating crkbd RGB keymap implementation & ninjonas userspace updates (#6834)
* [keymap] Updating crkbd RGB implementation & ninjonas userspace updates
* [chore] adding process_record_oled method to process_records.h
Diffstat (limited to 'users/ninjonas')
| -rw-r--r-- | users/ninjonas/README.md | 25 | ||||
| -rw-r--r-- | users/ninjonas/ninjonas.h | 3 | ||||
| -rw-r--r-- | users/ninjonas/oled.c | 14 | ||||
| -rw-r--r-- | users/ninjonas/process_records.c | 10 | ||||
| -rw-r--r-- | users/ninjonas/process_records.h | 14 |
5 files changed, 38 insertions, 28 deletions
diff --git a/users/ninjonas/README.md b/users/ninjonas/README.md index fb14bfe6c..32ccdc699 100644 --- a/users/ninjonas/README.md +++ b/users/ninjonas/README.md | |||
| @@ -16,7 +16,7 @@ See: https://docs.qmk.fm/#/feature_userspace | |||
| 16 | - [Lily58](../../keyboards/lily58/keymaps/ninjonas) | 16 | - [Lily58](../../keyboards/lily58/keymaps/ninjonas) |
| 17 | 17 | ||
| 18 | ## Features | 18 | ## Features |
| 19 | ### [Keys](ninjonas.h#L40) | 19 | ### [Keys](ninjonas.h#L37) |
| 20 | |Code | Description | | 20 | |Code | Description | |
| 21 | |---|---| | 21 | |---|---| |
| 22 | |K_LOCK | MacOS shortcut to execute lock command + ctrl + Q | | 22 | |K_LOCK | MacOS shortcut to execute lock command + ctrl + Q | |
| @@ -25,7 +25,7 @@ See: https://docs.qmk.fm/#/feature_userspace | |||
| 25 | |K_RAPP | MacOS shortcut to switch apps to the right | | 25 | |K_RAPP | MacOS shortcut to switch apps to the right | |
| 26 | |K_LAPP | MacOS shortcut to switch apps to the left | | 26 | |K_LAPP | MacOS shortcut to switch apps to the left | |
| 27 | 27 | ||
| 28 | ### [Layers](ninjonas.h#L47) | 28 | ### [Layers](ninjonas.h#L44) |
| 29 | |Code | Description | | 29 | |Code | Description | |
| 30 | |---|---| | 30 | |---|---| |
| 31 | |LT_LOW | Tap for ENTER, hold for RAISE | | 31 | |LT_LOW | Tap for ENTER, hold for RAISE | |
| @@ -34,7 +34,7 @@ See: https://docs.qmk.fm/#/feature_userspace | |||
| 34 | |LM_LOW | Dedicated key to momentarily toggle to use LOWER layer | | 34 | |LM_LOW | Dedicated key to momentarily toggle to use LOWER layer | |
| 35 | |LM_RAI | Dedicated key to momentarily toggle to use RAISE layer | | 35 | |LM_RAI | Dedicated key to momentarily toggle to use RAISE layer | |
| 36 | 36 | ||
| 37 | ### [Layout Blocks](ninjonas.h#L53) | 37 | ### [Layout Blocks](ninjonas.h#L50) |
| 38 | Predefined keyboard layout templates to speed up configuring split keyboards | 38 | Predefined keyboard layout templates to speed up configuring split keyboards |
| 39 | 39 | ||
| 40 | |Code | Description | | 40 | |Code | Description | |
| @@ -59,6 +59,7 @@ Predefined keyboard layout templates to speed up configuring split keyboards | |||
| 59 | |M_VRSN | macro to send QMK version | | 59 | |M_VRSN | macro to send QMK version | |
| 60 | |M_SHFT | Sends + alt + shift to a keycode to activate [ShiftIt](https://github.com/fikovnik/ShiftIt) | | 60 | |M_SHFT | Sends + alt + shift to a keycode to activate [ShiftIt](https://github.com/fikovnik/ShiftIt) | |
| 61 | |M_CODE | Opens [Visual Studio Code](https://code.visualstudio.com/) on current directory | | 61 | |M_CODE | Opens [Visual Studio Code](https://code.visualstudio.com/) on current directory | |
| 62 | |M_XXX1 to M_XXX5 | Reserved for secret macros see [Secrets](#secrets) | | ||
| 62 | 63 | ||
| 63 | ### [Tap-Dance](tap_dances.h) | 64 | ### [Tap-Dance](tap_dances.h) |
| 64 | |Code | Description | | 65 | |Code | Description | |
| @@ -73,21 +74,29 @@ Predefined keyboard layout templates to speed up configuring split keyboards | |||
| 73 | |T_Q | Tap for Q, double tap for + Q | | 74 | |T_Q | Tap for Q, double tap for + Q | |
| 74 | 75 | ||
| 75 | ### Secrets | 76 | ### Secrets |
| 76 | There's times where you have macros you don't want to share like emails, passwords 😱, & and private strings. Based off [drashna's secret macros](https://github.com/qmk/qmk_firmware/blob/master/users/drashna/readme_secrets.md), it's now possible to do this. All you need to do is create a `secrets.c` file. Below is an example of how this is used. | 77 | There's times where you have macros you don't want to share like emails, an address you need but you always forget, passwords 😱, & and private strings. Based off [drashna's secret macros](https://github.com/qmk/qmk_firmware/blob/master/users/drashna/readme_secrets.md), it's now possible to do this. All you need to do is create a `secrets.c` file. Below is an example of how this is used. |
| 77 | 78 | ||
| 78 | ```c | 79 | ```c |
| 79 | // secrets.c | 80 | // secrets.c |
| 80 | #include "ninjonas.h" | 81 | #include "ninjonas.h" |
| 82 | |||
| 83 | static const char * const secret[] = { | ||
| 84 | "BLANK1", | ||
| 85 | "BLANK2", | ||
| 86 | "BLANK3", | ||
| 87 | "BLANK4", | ||
| 88 | "BLANK5" | ||
| 89 | }; | ||
| 81 | 90 | ||
| 82 | bool process_record_secrets(uint16_t keycode, keyrecord_t *record) { | 91 | bool process_record_secrets(uint16_t keycode, keyrecord_t *record) { |
| 83 | switch (keycode) { | 92 | switch (keycode) { |
| 84 | // Sends zoom URL | 93 | case M_XXX1...M_XXX5: |
| 85 | case M_ZOOM: | ||
| 86 | if (record->event.pressed) { | 94 | if (record->event.pressed) { |
| 87 | SEND_STRING("SECRET_STRING_HERE" SS_TAP(X_ENTER)); | 95 | send_string(secret[keycode - M_XXX1]); |
| 88 | } | 96 | } |
| 89 | break; | 97 | break; |
| 90 | } | 98 | } |
| 91 | return true; | 99 | return true; |
| 92 | } | 100 | } |
| 101 | |||
| 93 | ``` \ No newline at end of file | 102 | ``` \ No newline at end of file |
diff --git a/users/ninjonas/ninjonas.h b/users/ninjonas/ninjonas.h index 227534c25..fdba68370 100644 --- a/users/ninjonas/ninjonas.h +++ b/users/ninjonas/ninjonas.h | |||
| @@ -26,9 +26,6 @@ | |||
| 26 | #include "lufa.h" | 26 | #include "lufa.h" |
| 27 | #include "split_util.h" | 27 | #include "split_util.h" |
| 28 | #endif | 28 | #endif |
| 29 | #ifdef SSD1306OLED | ||
| 30 | #include "ssd1306.h" | ||
| 31 | #endif | ||
| 32 | 29 | ||
| 33 | #define _QWERTY 0 | 30 | #define _QWERTY 0 |
| 34 | #define _DVORAK 1 | 31 | #define _DVORAK 1 |
diff --git a/users/ninjonas/oled.c b/users/ninjonas/oled.c index 837d497ab..8a9c99593 100644 --- a/users/ninjonas/oled.c +++ b/users/ninjonas/oled.c | |||
| @@ -7,10 +7,10 @@ | |||
| 7 | static uint16_t oled_timer = 0; | 7 | static uint16_t oled_timer = 0; |
| 8 | extern uint8_t is_master; | 8 | extern uint8_t is_master; |
| 9 | 9 | ||
| 10 | bool process_record_oled(uint16_t keycode, keyrecord_t *record) { | 10 | bool process_record_oled(uint16_t keycode, keyrecord_t *record) { |
| 11 | if (record->event.pressed) { | 11 | if (record->event.pressed) { |
| 12 | oled_timer = timer_read(); | 12 | oled_timer = timer_read(); |
| 13 | } | 13 | } |
| 14 | return true; | 14 | return true; |
| 15 | } | 15 | } |
| 16 | 16 | ||
| @@ -48,6 +48,7 @@ void render_mod_status(uint8_t modifiers) { | |||
| 48 | 48 | ||
| 49 | void render_status(void){ | 49 | void render_status(void){ |
| 50 | render_default_layer_state(); | 50 | render_default_layer_state(); |
| 51 | oled_write_P(PSTR("\n"), false); | ||
| 51 | render_layer_state(); | 52 | render_layer_state(); |
| 52 | render_mod_status(get_mods()|get_oneshot_mods()); | 53 | render_mod_status(get_mods()|get_oneshot_mods()); |
| 53 | } | 54 | } |
| @@ -70,12 +71,13 @@ void oled_task_user(void) { | |||
| 70 | #ifndef SPLIT_KEYBOARD | 71 | #ifndef SPLIT_KEYBOARD |
| 71 | else { oled_on(); } | 72 | else { oled_on(); } |
| 72 | #endif | 73 | #endif |
| 73 | 74 | ||
| 74 | if (is_master) { | 75 | if (is_master) { |
| 75 | render_status(); | 76 | render_status(); |
| 76 | } else { | 77 | } else { |
| 77 | render_logo(); | 78 | oled_write_P(PSTR("\n"), false); |
| 78 | oled_scroll_left(); | 79 | render_logo(); |
| 80 | oled_scroll_left(); | ||
| 79 | } | 81 | } |
| 80 | } | 82 | } |
| 81 | 83 | ||
diff --git a/users/ninjonas/process_records.c b/users/ninjonas/process_records.c index e1960aaa3..6ec5be597 100644 --- a/users/ninjonas/process_records.c +++ b/users/ninjonas/process_records.c | |||
| @@ -12,18 +12,16 @@ bool process_record_oled(uint16_t keycode, keyrecord_t *record) { return true; } | |||
| 12 | #endif | 12 | #endif |
| 13 | 13 | ||
| 14 | bool process_record_user(uint16_t keycode, keyrecord_t *record) { | 14 | bool process_record_user(uint16_t keycode, keyrecord_t *record) { |
| 15 | if (record->event.pressed) { | 15 | #ifdef OLED_DRIVER_ENABLE |
| 16 | #ifdef OLED_DRIVER_ENABLE | 16 | process_record_oled(keycode, record); |
| 17 | process_record_oled(keycode, record); | 17 | #endif |
| 18 | #endif | ||
| 19 | } | ||
| 20 | 18 | ||
| 21 | switch (keycode) { | 19 | switch (keycode) { |
| 22 | 20 | ||
| 23 | // Sends pyenv to activate 'jira' environment | 21 | // Sends pyenv to activate 'jira' environment |
| 24 | case M_PYNV: | 22 | case M_PYNV: |
| 25 | if (record->event.pressed) { | 23 | if (record->event.pressed) { |
| 26 | SEND_STRING("pyenv activate jira" SS_TAP(X_ENTER)); | 24 | SEND_STRING("pyenv activate jira\n"); |
| 27 | } | 25 | } |
| 28 | break; | 26 | break; |
| 29 | 27 | ||
diff --git a/users/ninjonas/process_records.h b/users/ninjonas/process_records.h index 37d88d0ca..07babdd58 100644 --- a/users/ninjonas/process_records.h +++ b/users/ninjonas/process_records.h | |||
| @@ -7,7 +7,6 @@ enum custom_keycodes { | |||
| 7 | DVORAK, | 7 | DVORAK, |
| 8 | COLEMAK, | 8 | COLEMAK, |
| 9 | // Custom Macros | 9 | // Custom Macros |
| 10 | M_ZOOM, | ||
| 11 | M_PYNV, | 10 | M_PYNV, |
| 12 | M_SHFT, | 11 | M_SHFT, |
| 13 | M_MAKE, | 12 | M_MAKE, |
| @@ -15,11 +14,16 @@ enum custom_keycodes { | |||
| 15 | M_FLSH, | 14 | M_FLSH, |
| 16 | M_VRSN, | 15 | M_VRSN, |
| 17 | M_CODE, | 16 | M_CODE, |
| 17 | // Secret Macros | ||
| 18 | M_XXX1, | ||
| 19 | M_XXX2, | ||
| 20 | M_XXX3, | ||
| 21 | M_XXX4, | ||
| 22 | M_XXX5, | ||
| 18 | }; | 23 | }; |
| 19 | 24 | ||
| 20 | #ifdef SSD1306OLED | ||
| 21 | void set_keylog(uint16_t keycode, keyrecord_t *record); | ||
| 22 | #endif | ||
| 23 | |||
| 24 | bool process_record_secrets(uint16_t keycode, keyrecord_t *record); | 25 | bool process_record_secrets(uint16_t keycode, keyrecord_t *record); |
| 25 | bool process_record_keymap(uint16_t keycode, keyrecord_t *record); | 26 | bool process_record_keymap(uint16_t keycode, keyrecord_t *record); |
| 27 | #ifdef OLED_DRIVER_ENABLE | ||
| 28 | bool process_record_oled(uint16_t keycode, keyrecord_t *record); | ||
| 29 | #endif | ||
