diff options
Diffstat (limited to 'users/ninjonas')
| -rw-r--r-- | users/ninjonas/README.md | 13 | ||||
| -rw-r--r-- | users/ninjonas/ninjonas.h | 47 | ||||
| -rw-r--r-- | users/ninjonas/oled.c | 15 | ||||
| -rw-r--r-- | users/ninjonas/process_records.c | 21 | ||||
| -rw-r--r-- | users/ninjonas/process_records.h | 1 |
5 files changed, 76 insertions, 21 deletions
diff --git a/users/ninjonas/README.md b/users/ninjonas/README.md index 32ccdc699..1e3fe9c31 100644 --- a/users/ninjonas/README.md +++ b/users/ninjonas/README.md | |||
| @@ -19,7 +19,7 @@ See: https://docs.qmk.fm/#/feature_userspace | |||
| 19 | ### [Keys](ninjonas.h#L37) | 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 | |
| 23 | |K_CSCN | MacOS shortcut to copy a portion of the screen to the clipboard | | 23 | |K_CSCN | MacOS shortcut to copy a portion of the screen to the clipboard | |
| 24 | |K_MDSH | MacOS shortcut to get em-dash `–` | | 24 | |K_MDSH | MacOS shortcut to get em-dash `–` | |
| 25 | |K_RAPP | MacOS shortcut to switch apps to the right | | 25 | |K_RAPP | MacOS shortcut to switch apps to the right | |
| @@ -34,7 +34,13 @@ 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#L50) | 37 | ### [Mod-Taps](ninjonas.h#L50) |
| 38 | |Code | Description | | ||
| 39 | |---|---| | ||
| 40 | |MT_DEL | Tap for Delete, hold for + ALT + SHIFT | | ||
| 41 | |MT_EQL | Tap for =, hold for ALT + SHIFT | | ||
| 42 | |||
| 43 | ### [Layout Blocks](ninjonas.h#L54) | ||
| 38 | Predefined keyboard layout templates to speed up configuring split keyboards | 44 | Predefined keyboard layout templates to speed up configuring split keyboards |
| 39 | 45 | ||
| 40 | |Code | Description | | 46 | |Code | Description | |
| @@ -59,6 +65,7 @@ Predefined keyboard layout templates to speed up configuring split keyboards | |||
| 59 | |M_VRSN | macro to send QMK version | | 65 | |M_VRSN | macro to send QMK version | |
| 60 | |M_SHFT | Sends + alt + shift to a keycode to activate [ShiftIt](https://github.com/fikovnik/ShiftIt) | | 66 | |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 | | 67 | |M_CODE | Opens [Visual Studio Code](https://code.visualstudio.com/) on current directory | |
| 68 | |M_TERM | Launches Spotlight and calls Terminal | | ||
| 62 | |M_XXX1 to M_XXX5 | Reserved for secret macros see [Secrets](#secrets) | | 69 | |M_XXX1 to M_XXX5 | Reserved for secret macros see [Secrets](#secrets) | |
| 63 | 70 | ||
| 64 | ### [Tap-Dance](tap_dances.h) | 71 | ### [Tap-Dance](tap_dances.h) |
| @@ -78,7 +85,7 @@ There's times where you have macros you don't want to share like emails, an addr | |||
| 78 | 85 | ||
| 79 | ```c | 86 | ```c |
| 80 | // secrets.c | 87 | // secrets.c |
| 81 | #include "ninjonas.h" | 88 | #include "ninjonas.h" |
| 82 | 89 | ||
| 83 | static const char * const secret[] = { | 90 | static const char * const secret[] = { |
| 84 | "BLANK1", | 91 | "BLANK1", |
diff --git a/users/ninjonas/ninjonas.h b/users/ninjonas/ninjonas.h index fdba68370..b86ccc733 100644 --- a/users/ninjonas/ninjonas.h +++ b/users/ninjonas/ninjonas.h | |||
| @@ -47,6 +47,10 @@ | |||
| 47 | #define LT_LOW LT(_LOWER, KC_ENT) | 47 | #define LT_LOW LT(_LOWER, KC_ENT) |
| 48 | #define LT_RAI LT(_RAISE, KC_SPC) | 48 | #define LT_RAI LT(_RAISE, KC_SPC) |
| 49 | 49 | ||
| 50 | // Mod-Tap Keys | ||
| 51 | #define MT_DEL MT(MOD_LGUI | MOD_LALT | MOD_LSFT, KC_DEL) | ||
| 52 | #define MT_EQL MT(MOD_LALT | MOD_LSFT, KC_EQL) | ||
| 53 | |||
| 50 | // Layout blocks | 54 | // Layout blocks |
| 51 | #define _____________________QWERTY_L1______________________ T_TAB, T_Q, T_W, KC_E, KC_R, KC_T | 55 | #define _____________________QWERTY_L1______________________ T_TAB, T_Q, T_W, KC_E, KC_R, KC_T |
| 52 | #define _____________________QWERTY_L2______________________ T_ESC, KC_A, KC_S, KC_D, KC_F, KC_G | 56 | #define _____________________QWERTY_L2______________________ T_ESC, KC_A, KC_S, KC_D, KC_F, KC_G |
| @@ -54,7 +58,7 @@ | |||
| 54 | 58 | ||
| 55 | #define _____________________QWERTY_R1______________________ KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS | 59 | #define _____________________QWERTY_R1______________________ KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS |
| 56 | #define _____________________QWERTY_R2______________________ KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT | 60 | #define _____________________QWERTY_R2______________________ KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT |
| 57 | #define _____________________QWERTY_R3______________________ KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_EQL | 61 | #define _____________________QWERTY_R3______________________ KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, MT_EQL |
| 58 | 62 | ||
| 59 | #define _____________________DVORAK_L1______________________ T_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y | 63 | #define _____________________DVORAK_L1______________________ T_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y |
| 60 | #define _____________________DVORAK_L2______________________ T_ESC, KC_A, KC_O, KC_E, KC_U, KC_I | 64 | #define _____________________DVORAK_L2______________________ T_ESC, KC_A, KC_O, KC_E, KC_U, KC_I |
| @@ -62,7 +66,7 @@ | |||
| 62 | 66 | ||
| 63 | #define _____________________DVORAK_R1______________________ KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSLS | 67 | #define _____________________DVORAK_R1______________________ KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSLS |
| 64 | #define _____________________DVORAK_R2______________________ KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH | 68 | #define _____________________DVORAK_R2______________________ KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH |
| 65 | #define _____________________DVORAK_R3______________________ KC_B, KC_M, T_W, KC_V, KC_Z, KC_EQL | 69 | #define _____________________DVORAK_R3______________________ KC_B, KC_M, T_W, KC_V, KC_Z, MT_EQL |
| 66 | 70 | ||
| 67 | #define _____________________COLEMAK_L1_____________________ T_TAB, T_Q, T_W, KC_F, KC_P, KC_G | 71 | #define _____________________COLEMAK_L1_____________________ T_TAB, T_Q, T_W, KC_F, KC_P, KC_G |
| 68 | #define _____________________COLEMAK_L2_____________________ T_ESC, KC_A, KC_R, KC_S, KC_T, KC_D | 72 | #define _____________________COLEMAK_L2_____________________ T_ESC, KC_A, KC_R, KC_S, KC_T, KC_D |
| @@ -70,7 +74,7 @@ | |||
| 70 | 74 | ||
| 71 | #define _____________________COLEMAK_R1_____________________ KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSLS | 75 | #define _____________________COLEMAK_R1_____________________ KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSLS |
| 72 | #define _____________________COLEMAK_R2_____________________ KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT | 76 | #define _____________________COLEMAK_R2_____________________ KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT |
| 73 | #define _____________________COLEMAK_R3_____________________ KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_EQL | 77 | #define _____________________COLEMAK_R3_____________________ KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, MT_EQL |
| 74 | 78 | ||
| 75 | #define _____________________NUM_LEFT_______________________ T_GRV, KC_1, KC_2, KC_3, KC_4, KC_5 | 79 | #define _____________________NUM_LEFT_______________________ T_GRV, KC_1, KC_2, KC_3, KC_4, KC_5 |
| 76 | #define _____________________NUM_RIGHT______________________ KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS | 80 | #define _____________________NUM_RIGHT______________________ KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS |
| @@ -81,8 +85,31 @@ | |||
| 81 | #define _____________________SYM_LEFT_______________________ KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC | 85 | #define _____________________SYM_LEFT_______________________ KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC |
| 82 | #define _____________________SYM_RIGHT______________________ KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_UNDS | 86 | #define _____________________SYM_RIGHT______________________ KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_UNDS |
| 83 | 87 | ||
| 84 | #define ____________________________________________________ _______, _______, _______, _______, _______, _______ | 88 | #define _____________________LOWER_L1_______________________ M_XXX2, M_XXX3, _________MEDIA_1_________, K_CSCN |
| 85 | #define _____________________XXXXXXX________________________ XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX | 89 | #define _____________________LOWER_L2_______________________ M_XXX4, M_XXX5, _________MEDIA_2_________, XXXXXXX |
| 90 | #define _____________________LOWER_L3_______________________ KC_LSFT, M_SHFT, _________MEDIA_3_________, T_LBRC | ||
| 91 | |||
| 92 | #define _____________________LOWER_R1_______________________ _______________NAV_1______________, XXXXXXX, K_MDSH | ||
| 93 | #define _____________________LOWER_R2_______________________ _______________NAV_2______________, K_LOCK, XXXXXXX | ||
| 94 | #define _____________________LOWER_R3_______________________ T_RBRC, KC_M, M_TERM, M_CODE, M_XXX1, M_PYNV | ||
| 95 | |||
| 96 | #define _____________________ADJUST_L1______________________ M_MAKE, EEP_RST, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX | ||
| 97 | #ifdef RGB_MATRIX_ENABLE | ||
| 98 | #define _____________________ADJUST_L2______________________ M_VRSN, M_MALL, RGB_SPI, RGB_SAI, RGB_HUI, RGB_VAI | ||
| 99 | #define _____________________ADJUST_L3______________________ M_FLSH, XXXXXXX, RGB_SPD, RGB_SAD, RGB_HUD, RGB_VAD | ||
| 100 | #else | ||
| 101 | #define _____________________ADJUST_L2______________________ M_VRSN, M_MALL, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX | ||
| 102 | #define _____________________ADJUST_L3______________________ M_FLSH, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX | ||
| 103 | #endif | ||
| 104 | |||
| 105 | #ifdef RGB_MATRIX_ENABLE | ||
| 106 | #define _____________________ADJUST_R1______________________ RGB_TOG, XXXXXXX, XXXXXXX, COLEMAK, DVORAK, QWERTY | ||
| 107 | #define _____________________ADJUST_R3______________________ RGB_MOD, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX | ||
| 108 | #else | ||
| 109 | #define _____________________ADJUST_R1______________________ XXXXXXX, XXXXXXX, XXXXXXX, COLEMAK, DVORAK, QWERTY | ||
| 110 | #define _____________________ADJUST_R3______________________ XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX | ||
| 111 | #endif | ||
| 112 | #define _____________________ADJUST_R2______________________ XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX | ||
| 86 | 113 | ||
| 87 | #define _______________NAV_1______________ KC_PGUP, KC_HOME, KC_UP, KC_END | 114 | #define _______________NAV_1______________ KC_PGUP, KC_HOME, KC_UP, KC_END |
| 88 | #define _______________NAV_2______________ KC_PGDN, KC_LEFT, KC_DOWN, KC_RGHT | 115 | #define _______________NAV_2______________ KC_PGDN, KC_LEFT, KC_DOWN, KC_RGHT |
| @@ -91,14 +118,18 @@ | |||
| 91 | #define _____________MOUSE_2______________ KC_MS_L, KC_MS_D, KC_MS_R, KC_WH_U | 118 | #define _____________MOUSE_2______________ KC_MS_L, KC_MS_D, KC_MS_R, KC_WH_U |
| 92 | 119 | ||
| 93 | #define __________________________________ _______, _______, _______, _______ | 120 | #define __________________________________ _______, _______, _______, _______ |
| 94 | #define _____________XXXXXXX______________ XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX | ||
| 95 | 121 | ||
| 96 | #define _________MEDIA_1_________ KC_BRIU, KC_MPLY, KC_MUTE | 122 | #define _________MEDIA_1_________ KC_BRIU, KC_MPLY, KC_MUTE |
| 97 | #define _________MEDIA_2_________ KC_BRID, KC_MFFD, KC__VOLUP | 123 | #define _________MEDIA_2_________ KC_BRID, KC_MFFD, KC__VOLUP |
| 98 | #define _________MEDIA_3_________ XXXXXXX, KC_MRWD, KC__VOLDOWN | 124 | #define _________MEDIA_3_________ XXXXXXX, KC_MRWD, KC__VOLDOWN |
| 99 | 125 | ||
| 100 | #define ________MOD_LEFT_________ KC_LALT, T_GUI, KC_LCTL | 126 | #ifdef KEYBOARD_crkbd_rev1 |
| 101 | #define ________MOD_RIGHT________ KC_BSPC, KC_DEL, LM_LOW | 127 | #define ________MOD_LEFT_________ T_GUI, KC_LCTL, LT_RAI |
| 128 | #define ________MOD_RIGHT________ LT_LOW, KC_BSPC, MT_DEL | ||
| 129 | #else | ||
| 130 | #define ________MOD_LEFT_________ KC_LALT, T_GUI, KC_LCTL | ||
| 131 | #define ________MOD_RIGHT________ KC_BSPC, MT_DEL, LM_LOW | ||
| 132 | #endif | ||
| 102 | 133 | ||
| 103 | // Layout wrappers | 134 | // Layout wrappers |
| 104 | #define LAYOUT_wrapper(...) LAYOUT(__VA_ARGS__) | 135 | #define LAYOUT_wrapper(...) LAYOUT(__VA_ARGS__) |
diff --git a/users/ninjonas/oled.c b/users/ninjonas/oled.c index 8a9c99593..721038e15 100644 --- a/users/ninjonas/oled.c +++ b/users/ninjonas/oled.c | |||
| @@ -4,12 +4,19 @@ | |||
| 4 | 4 | ||
| 5 | #ifdef OLED_DRIVER_ENABLE | 5 | #ifdef OLED_DRIVER_ENABLE |
| 6 | 6 | ||
| 7 | static uint16_t oled_timer = 0; | 7 | static uint32_t oled_timer = 0; |
| 8 | extern uint8_t is_master; | 8 | extern uint8_t is_master; |
| 9 | 9 | ||
| 10 | oled_rotation_t oled_init_user(oled_rotation_t rotation) { | ||
| 11 | if (is_master) { | ||
| 12 | return OLED_ROTATION_0; | ||
| 13 | } | ||
| 14 | return OLED_ROTATION_180; | ||
| 15 | } | ||
| 16 | |||
| 10 | bool process_record_oled(uint16_t keycode, keyrecord_t *record) { | 17 | bool process_record_oled(uint16_t keycode, keyrecord_t *record) { |
| 11 | if (record->event.pressed) { | 18 | if (record->event.pressed) { |
| 12 | oled_timer = timer_read(); | 19 | oled_timer = timer_read32(); |
| 13 | } | 20 | } |
| 14 | return true; | 21 | return true; |
| 15 | } | 22 | } |
| @@ -64,7 +71,7 @@ static void render_logo(void) { | |||
| 64 | } | 71 | } |
| 65 | 72 | ||
| 66 | void oled_task_user(void) { | 73 | void oled_task_user(void) { |
| 67 | if (timer_elapsed(oled_timer) > 30000) { | 74 | if (timer_elapsed32(oled_timer) > 30000) { |
| 68 | oled_off(); | 75 | oled_off(); |
| 69 | return; | 76 | return; |
| 70 | } | 77 | } |
| @@ -75,8 +82,8 @@ void oled_task_user(void) { | |||
| 75 | if (is_master) { | 82 | if (is_master) { |
| 76 | render_status(); | 83 | render_status(); |
| 77 | } else { | 84 | } else { |
| 78 | oled_write_P(PSTR("\n"), false); | ||
| 79 | render_logo(); | 85 | render_logo(); |
| 86 | oled_write_P(PSTR("\n"), false); | ||
| 80 | oled_scroll_left(); | 87 | oled_scroll_left(); |
| 81 | } | 88 | } |
| 82 | } | 89 | } |
diff --git a/users/ninjonas/process_records.c b/users/ninjonas/process_records.c index 6ec5be597..8044b49f1 100644 --- a/users/ninjonas/process_records.c +++ b/users/ninjonas/process_records.c | |||
| @@ -12,10 +12,6 @@ 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 | #ifdef OLED_DRIVER_ENABLE | ||
| 16 | process_record_oled(keycode, record); | ||
| 17 | #endif | ||
| 18 | |||
| 19 | switch (keycode) { | 15 | switch (keycode) { |
| 20 | 16 | ||
| 21 | // Sends pyenv to activate 'jira' environment | 17 | // Sends pyenv to activate 'jira' environment |
| @@ -81,7 +77,16 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { | |||
| 81 | // Opens Visual Studio Code on current directory | 77 | // Opens Visual Studio Code on current directory |
| 82 | case M_CODE: | 78 | case M_CODE: |
| 83 | if (record->event.pressed) { | 79 | if (record->event.pressed) { |
| 84 | SEND_STRING("code ." SS_TAP(X_ENTER)); | 80 | SEND_STRING("code .\n"); |
| 81 | } | ||
| 82 | break; | ||
| 83 | |||
| 84 | // Opens Terminal | ||
| 85 | case M_TERM: | ||
| 86 | if (record->event.pressed) { | ||
| 87 | SEND_STRING(SS_DOWN(X_LGUI) SS_TAP(X_SPACE) SS_UP(X_LGUI)); | ||
| 88 | wait_ms(250); | ||
| 89 | SEND_STRING("terminal\n"); | ||
| 85 | } | 90 | } |
| 86 | break; | 91 | break; |
| 87 | 92 | ||
| @@ -104,5 +109,9 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { | |||
| 104 | // END: Layer macros | 109 | // END: Layer macros |
| 105 | } | 110 | } |
| 106 | 111 | ||
| 107 | return process_record_keymap(keycode, record) && process_record_secrets(keycode, record); | 112 | return process_record_keymap(keycode, record) && process_record_secrets(keycode, record) |
| 113 | #ifdef OLED_DRIVER_ENABLE | ||
| 114 | && process_record_oled(keycode, record) | ||
| 115 | #endif | ||
| 116 | ; // Close return | ||
| 108 | } | 117 | } |
diff --git a/users/ninjonas/process_records.h b/users/ninjonas/process_records.h index 07babdd58..2e69ca216 100644 --- a/users/ninjonas/process_records.h +++ b/users/ninjonas/process_records.h | |||
| @@ -14,6 +14,7 @@ enum custom_keycodes { | |||
| 14 | M_FLSH, | 14 | M_FLSH, |
| 15 | M_VRSN, | 15 | M_VRSN, |
| 16 | M_CODE, | 16 | M_CODE, |
| 17 | M_TERM, | ||
| 17 | // Secret Macros | 18 | // Secret Macros |
| 18 | M_XXX1, | 19 | M_XXX1, |
| 19 | M_XXX2, | 20 | M_XXX2, |
