diff options
| author | Jonas Avellana <14019120+ninjonas@users.noreply.github.com> | 2019-09-02 08:40:01 -0600 |
|---|---|---|
| committer | Drashna Jaelre <drashna@live.com> | 2019-09-02 07:40:01 -0700 |
| commit | f2ea65db6b8834dcb2a21462f43c1d89add6b101 (patch) | |
| tree | 1620e9abc8bb455754ea50fd2d27a9c714e7ce03 /users/ninjonas | |
| parent | 0e153781f035876771dd421ac92136ff2897c7d9 (diff) | |
| download | qmk_firmware-f2ea65db6b8834dcb2a21462f43c1d89add6b101.tar.gz qmk_firmware-f2ea65db6b8834dcb2a21462f43c1d89add6b101.zip | |
[keymap] ninjonas userspace and keymaps for hotdox, lily58, & pinky3 (#6649)
* [keyboard] introducing ninjonas userspace & keymaps for hotdox, lily58, and pinky3
* [fix(#6649)] removed M_EPRM and used builtin EEP_RST keycode as-per review.
* [chore(#6649)] forgot to update keymap legend on lily58
Diffstat (limited to 'users/ninjonas')
| -rw-r--r-- | users/ninjonas/.gitignore | 1 | ||||
| -rw-r--r-- | users/ninjonas/README.md | 85 | ||||
| -rw-r--r-- | users/ninjonas/config.h | 14 | ||||
| -rw-r--r-- | users/ninjonas/ninjonas.c | 68 | ||||
| -rw-r--r-- | users/ninjonas/ninjonas.h | 112 | ||||
| -rw-r--r-- | users/ninjonas/process_records.c | 98 | ||||
| -rw-r--r-- | users/ninjonas/process_records.h | 24 | ||||
| -rw-r--r-- | users/ninjonas/rules.mk | 18 | ||||
| -rw-r--r-- | users/ninjonas/tap_dances.c | 12 | ||||
| -rw-r--r-- | users/ninjonas/tap_dances.h | 22 |
10 files changed, 454 insertions, 0 deletions
diff --git a/users/ninjonas/.gitignore b/users/ninjonas/.gitignore new file mode 100644 index 000000000..c6df8c013 --- /dev/null +++ b/users/ninjonas/.gitignore | |||
| @@ -0,0 +1 @@ | |||
| secrets.c | |||
diff --git a/users/ninjonas/README.md b/users/ninjonas/README.md new file mode 100644 index 000000000..82bd5f09a --- /dev/null +++ b/users/ninjonas/README.md | |||
| @@ -0,0 +1,85 @@ | |||
| 1 | # QMK User Configuration for [ninjonas](https://github.com/ninjonas/qmk-yonas) | ||
| 2 | Tired of copying and pasting the same macros and tap dances for all my keymaps. Utilizing user keymaps functionality. | ||
| 3 | See: https://docs.qmk.fm/#/feature_userspace | ||
| 4 | |||
| 5 | ## [ninjonas.c](ninjonas.c) | ||
| 6 | - ninjonas [QMK user configuration](https://github.com/qmk/qmk_firmware/blob/master/docs/feature_userspace.md) | ||
| 7 | - On `keymap.c` include `ninjonas.h` | ||
| 8 | ```c | ||
| 9 | #include "ninjonas.h" | ||
| 10 | ``` | ||
| 11 | |||
| 12 | ## Features | ||
| 13 | ### [Keys](ninjonas.h#L44) | ||
| 14 | |Code | Description | | ||
| 15 | |---|---| | ||
| 16 | |K_LOCK | MacOS shortcut to execute lock command + ctrl + Q | | ||
| 17 | |K_CSCN | MacOS shortcut to copy a portion of the screen to the clipboard | | ||
| 18 | |||
| 19 | ### [Layers](ninjonas.h#L48) | ||
| 20 | |Code | Description | | ||
| 21 | |---|---| | ||
| 22 | |LT_LOW | Tap for ENTER, hold for RAISE | | ||
| 23 | |LT_FUNC | Tap for ENTER, hold for FUNCTIONS | | ||
| 24 | |LT_RAI | Tap for SPACE, hold for LOWER | | ||
| 25 | |LT_NUM | Tap for SPACE, hold for NUMBERS | | ||
| 26 | |LT_LOW + LT_RAI | Hold for ADJUST | | ||
| 27 | |L_LOWER | Dedicated key to momentarily toggle to use LOWER layer | | ||
| 28 | |||
| 29 | ### [Layout Blocks](ninjonas.h#L57) | ||
| 30 | Predefined keyboard layout templates to speed up configuring split keyboards | ||
| 31 | |||
| 32 | |Code | Description | | ||
| 33 | |---|---| | ||
| 34 | |QWERTY | Qwerty Layout | | ||
| 35 | |DVORAK | Dvorak Layout | | ||
| 36 | |COLEMAK | Colemak Layout | | ||
| 37 | |NUM | Number Rows | | ||
| 38 | |FUNC | Function Rows | | ||
| 39 | |SYM | Symbol Rows \(When holding shift on numbers\) | | ||
| 40 | |NAV | Navigation Cluster | | ||
| 41 | |MOUSE | Mouse Cluster | | ||
| 42 | |MEDIA | Media Cluster | | ||
| 43 | |MOD | Modifier Cluster | | ||
| 44 | |||
| 45 | ### [Macros](process_records.c) | ||
| 46 | |Code | Description | | ||
| 47 | |---|---| | ||
| 48 | |M_PYNV | macro to activate pyenv with the name `jira` | | ||
| 49 | |M_MAKE | macro to send QMK make command to compile keyboard | | ||
| 50 | |M_FLSH | macro to send QMK make command to compile keyboard with the correct bootloader | | ||
| 51 | |M_VRSN | macro to send QMK version | | ||
| 52 | |M_SHFT | Sends + alt + shift to a keycode to activate [ShiftIt](https://github.com/fikovnik/ShiftIt) | | ||
| 53 | |M_CODE | Opens [Visual Studio Code](https://code.visualstudio.com/) on current directory | | ||
| 54 | |||
| 55 | ### [Tap-Dance](tap_dances.h) | ||
| 56 | |Code | Description | | ||
| 57 | |---|---| | ||
| 58 | |T_ESC | Tap once for ESC, double tap for CAPS_LOCK | | ||
| 59 | |T_LBRC | Tap once for [, double for back browser | | ||
| 60 | |T_RBRC | Tap once for ], double for forward browser | | ||
| 61 | |T_TAB | Tap once for TAB, double for CTRL + TAB | | ||
| 62 | |T_GRV | Tap once for GRV, double for + GRV | | ||
| 63 | |T_GUI | Tap once for , double to open spotlight | | ||
| 64 | |T_W | Tap for W, double tap for + W | | ||
| 65 | |T_Q | Tap for Q, double tap for + Q | | ||
| 66 | |||
| 67 | ### Secrets | ||
| 68 | 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. | ||
| 69 | |||
| 70 | ```c | ||
| 71 | // secrets.c | ||
| 72 | #include "ninjonas.h" | ||
| 73 | |||
| 74 | bool process_record_secrets(uint16_t keycode, keyrecord_t *record) { | ||
| 75 | switch (keycode) { | ||
| 76 | // Sends zoom URL | ||
| 77 | case M_ZOOM: | ||
| 78 | if (record->event.pressed) { | ||
| 79 | SEND_STRING("SECRET_STRING_HERE" SS_TAP(X_ENTER)); | ||
| 80 | } | ||
| 81 | break; | ||
| 82 | } | ||
| 83 | return true; | ||
| 84 | } | ||
| 85 | ``` \ No newline at end of file | ||
diff --git a/users/ninjonas/config.h b/users/ninjonas/config.h new file mode 100644 index 000000000..1166939c6 --- /dev/null +++ b/users/ninjonas/config.h | |||
| @@ -0,0 +1,14 @@ | |||
| 1 | #ifdef TAPPING_TERM | ||
| 2 | #undef TAPPING_TERM | ||
| 3 | #define TAPPING_TERM 200 | ||
| 4 | #endif | ||
| 5 | |||
| 6 | // Mouse Settings: Smoothing out mouse movement on keypress | ||
| 7 | #ifndef MOUSEKEY_INTERVAL | ||
| 8 | #undef MOUSEKEY_INTERVAL | ||
| 9 | #define MOUSEKEY_INTERVAL 16 | ||
| 10 | #endif | ||
| 11 | #define MOUSEKEY_DELAY 0 | ||
| 12 | #define MOUSEKEY_TIME_TO_MAX 60 | ||
| 13 | #define MOUSEKEY_MAX_SPEED 7 | ||
| 14 | #define MOUSEKEY_WHEEL_DELAY 0 \ No newline at end of file | ||
diff --git a/users/ninjonas/ninjonas.c b/users/ninjonas/ninjonas.c new file mode 100644 index 000000000..6a77ecf8b --- /dev/null +++ b/users/ninjonas/ninjonas.c | |||
| @@ -0,0 +1,68 @@ | |||
| 1 | /* Copyright 2019 @ninjonas | ||
| 2 | * | ||
| 3 | * This program is free software: you can redistribute it and/or modify | ||
| 4 | * it under the terms of the GNU General Public License as published by | ||
| 5 | * the Free Software Foundation, either version 2 of the License, or | ||
| 6 | * (at your option) any later version. | ||
| 7 | * | ||
| 8 | * This program is distributed in the hope that it will be useful, | ||
| 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 11 | * GNU General Public License for more details. | ||
| 12 | * | ||
| 13 | * You should have received a copy of the GNU General Public License | ||
| 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 15 | */ | ||
| 16 | #include "ninjonas.h" | ||
| 17 | |||
| 18 | layer_state_t layer_state_set_user (layer_state_t state) { | ||
| 19 | return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); | ||
| 20 | } | ||
| 21 | |||
| 22 | // BEGIN: SSD1306OLED | ||
| 23 | // SSD1306 OLED update loop, make sure to add #define SSD1306OLED in config.h | ||
| 24 | #if defined(KEYBOARD_lily58_rev1) & defined(PROTOCOL_LUFA) | ||
| 25 | extern uint8_t is_master; | ||
| 26 | |||
| 27 | void matrix_init_user(void) { | ||
| 28 | //SSD1306 OLED init, make sure to add #define SSD1306OLED in config.h | ||
| 29 | iota_gfx_init(!has_usb()); // turns on the display | ||
| 30 | } | ||
| 31 | |||
| 32 | // When add source files to SRC in rules.mk, you can use functions. | ||
| 33 | const char *read_layer_state(void); | ||
| 34 | const char *read_logo(void); | ||
| 35 | //void set_keylog(uint16_t keycode, keyrecord_t *record); // Moved to process_records.h | ||
| 36 | const char *read_keylog(void); | ||
| 37 | const char *read_keylogs(void); | ||
| 38 | |||
| 39 | void matrix_scan_user(void) { | ||
| 40 | iota_gfx_task(); | ||
| 41 | } | ||
| 42 | |||
| 43 | void matrix_render_user(struct CharacterMatrix *matrix) { | ||
| 44 | if (is_master) { | ||
| 45 | // If you want to change the display of OLED, you need to change here | ||
| 46 | matrix_write_ln(matrix, read_layer_state()); | ||
| 47 | matrix_write_ln(matrix, read_keylog()); | ||
| 48 | matrix_write_ln(matrix, read_keylogs()); | ||
| 49 | } else { | ||
| 50 | matrix_write(matrix, read_logo()); | ||
| 51 | } | ||
| 52 | } | ||
| 53 | |||
| 54 | void matrix_update(struct CharacterMatrix *dest, const struct CharacterMatrix *source) { | ||
| 55 | if (memcmp(dest->display, source->display, sizeof(dest->display))) { | ||
| 56 | memcpy(dest->display, source->display, sizeof(dest->display)); | ||
| 57 | dest->dirty = true; | ||
| 58 | } | ||
| 59 | } | ||
| 60 | |||
| 61 | void iota_gfx_task_user(void) { | ||
| 62 | struct CharacterMatrix matrix; | ||
| 63 | matrix_clear(&matrix); | ||
| 64 | matrix_render_user(&matrix); | ||
| 65 | matrix_update(&display, &matrix); | ||
| 66 | } | ||
| 67 | #endif | ||
| 68 | // END: SSD1306OLED \ No newline at end of file | ||
diff --git a/users/ninjonas/ninjonas.h b/users/ninjonas/ninjonas.h new file mode 100644 index 000000000..50d7c3680 --- /dev/null +++ b/users/ninjonas/ninjonas.h | |||
| @@ -0,0 +1,112 @@ | |||
| 1 | /* Copyright 2019 @ninjonas | ||
| 2 | * | ||
| 3 | * This program is free software: you can redistribute it and/or modify | ||
| 4 | * it under the terms of the GNU General Public License as published by | ||
| 5 | * the Free Software Foundation, either version 2 of the License, or | ||
| 6 | * (at your option) any later version. | ||
| 7 | * | ||
| 8 | * This program is distributed in the hope that it will be useful, | ||
| 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 11 | * GNU General Public License for more details. | ||
| 12 | * | ||
| 13 | * You should have received a copy of the GNU General Public License | ||
| 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 15 | */ | ||
| 16 | #pragma once | ||
| 17 | #include "quantum.h" | ||
| 18 | #include "version.h" | ||
| 19 | #include "eeprom.h" | ||
| 20 | #include "process_records.h" | ||
| 21 | |||
| 22 | #ifdef TAP_DANCE_ENABLE | ||
| 23 | #include "tap_dances.h" | ||
| 24 | #endif | ||
| 25 | #if defined(KEYBOARD_lily58_rev1) & defined(PROTOCOL_LUFA) | ||
| 26 | #include "lufa.h" | ||
| 27 | #include "split_util.h" | ||
| 28 | #endif | ||
| 29 | #ifdef SSD1306OLED | ||
| 30 | #include "ssd1306.h" | ||
| 31 | #endif | ||
| 32 | |||
| 33 | #define _QWERTY 0 | ||
| 34 | #define _DVORAK 1 | ||
| 35 | #define _COLEMAK 2 | ||
| 36 | #define _LOWER 3 | ||
| 37 | #define _RAISE 4 | ||
| 38 | #define _ADJUST 5 | ||
| 39 | #ifdef KEYBOARD_pinky_3 | ||
| 40 | #define _NUMBERS 6 | ||
| 41 | #define _FUNCTIONS 7 | ||
| 42 | #endif | ||
| 43 | |||
| 44 | // Shortcut Keys | ||
| 45 | #define K_LOCK LGUI(LCTL(KC_Q)) // Locks screen on MacOS | ||
| 46 | #define K_CSCN LGUI(LCTL(LSFT(KC_4))) // Copy a portion of the screen to the clipboard | ||
| 47 | |||
| 48 | // Layer Keys | ||
| 49 | #define L_LOWER MO(_LOWER) | ||
| 50 | #define LT_LOW LT(_LOWER, KC_ENT) | ||
| 51 | #define LT_RAI LT(_RAISE, KC_SPC) | ||
| 52 | #ifdef KEYBOARD_pinky_3 | ||
| 53 | #define LT_NUM LT(_NUMBERS, KC_SPC) | ||
| 54 | #define LT_FUNC LT(_FUNCTIONS, KC_ENT) | ||
| 55 | #endif | ||
| 56 | |||
| 57 | // Layout blocks | ||
| 58 | #define _____________________QWERTY_L1______________________ T_TAB, T_Q, T_W, KC_E, KC_R, KC_T | ||
| 59 | #define _____________________QWERTY_L2______________________ T_ESC, KC_A, KC_S, KC_D, KC_F, KC_G | ||
| 60 | #define _____________________QWERTY_L3______________________ KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B | ||
| 61 | |||
| 62 | #define _____________________QWERTY_R1______________________ KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS | ||
| 63 | #define _____________________QWERTY_R2______________________ KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT | ||
| 64 | #define _____________________QWERTY_R3______________________ KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_EQL | ||
| 65 | |||
| 66 | #define _____________________DVORAK_L1______________________ T_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y | ||
| 67 | #define _____________________DVORAK_L2______________________ T_ESC, KC_A, KC_O, KC_E, KC_U, KC_I | ||
| 68 | #define _____________________DVORAK_L3______________________ KC_LSFT, KC_SCLN, T_Q, KC_J, KC_K, KC_X | ||
| 69 | |||
| 70 | #define _____________________DVORAK_R1______________________ KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSLS | ||
| 71 | #define _____________________DVORAK_R2______________________ KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH | ||
| 72 | #define _____________________DVORAK_R3______________________ KC_B, KC_M, T_W, KC_V, KC_Z, KC_EQL | ||
| 73 | |||
| 74 | #define _____________________COLEMAK_L1_____________________ T_TAB, T_Q, T_W, KC_F, KC_P, KC_G | ||
| 75 | #define _____________________COLEMAK_L2_____________________ T_ESC, KC_A, KC_R, KC_S, KC_T, KC_D | ||
| 76 | #define _____________________COLEMAK_L3_____________________ KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B | ||
| 77 | |||
| 78 | #define _____________________COLEMAK_R1_____________________ KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSLS | ||
| 79 | #define _____________________COLEMAK_R2_____________________ KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT | ||
| 80 | #define _____________________COLEMAK_R3_____________________ KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_EQL | ||
| 81 | |||
| 82 | #define _____________________NUM_LEFT_______________________ T_GRV, KC_1, KC_2, KC_3, KC_4, KC_5 | ||
| 83 | #define _____________________NUM_RIGHT______________________ KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS | ||
| 84 | |||
| 85 | #define _____________________FUNC_LEFT______________________ KC_F11, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5 | ||
| 86 | #define _____________________FUNC_RIGHT_____________________ KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F12 | ||
| 87 | |||
| 88 | #define _____________________SYM_LEFT_______________________ KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC | ||
| 89 | #define _____________________SYM_RIGHT______________________ KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_UNDS | ||
| 90 | |||
| 91 | #define ____________________________________________________ _______, _______, _______, _______, _______, _______ | ||
| 92 | #define _____________________XXXXXXX________________________ XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX | ||
| 93 | |||
| 94 | #define _______________NAV_1______________ KC_PGUP, KC_HOME, KC_UP, KC_END | ||
| 95 | #define _______________NAV_2______________ KC_PGDN, KC_LEFT, KC_DOWN, KC_RGHT | ||
| 96 | |||
| 97 | #define _____________MOUSE_1______________ KC_BTN1, KC_MS_U, KC_BTN2, KC_WH_D | ||
| 98 | #define _____________MOUSE_2______________ KC_MS_L, KC_MS_D, KC_MS_R, KC_WH_U | ||
| 99 | |||
| 100 | #define __________________________________ _______, _______, _______, _______ | ||
| 101 | #define _____________XXXXXXX______________ XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX | ||
| 102 | |||
| 103 | #define _________MEDIA_1_________ KC_BRIU, KC_MPLY, KC_MUTE | ||
| 104 | #define _________MEDIA_2_________ KC_BRID, KC_MFFD, KC__VOLUP | ||
| 105 | #define _________MEDIA_3_________ XXXXXXX, KC_MRWD, KC__VOLDOWN | ||
| 106 | |||
| 107 | #define ________MOD_LEFT_________ KC_LALT, T_GUI, KC_LCTL | ||
| 108 | #define ________MOD_RIGHT________ KC_BSPC, KC_DEL, L_LOWER | ||
| 109 | |||
| 110 | // Layout wrappers | ||
| 111 | #define LAYOUT_wrapper(...) LAYOUT(__VA_ARGS__) | ||
| 112 | #define LAYOUT_ergodox_wrapper(...) LAYOUT_ergodox(__VA_ARGS__) \ No newline at end of file | ||
diff --git a/users/ninjonas/process_records.c b/users/ninjonas/process_records.c new file mode 100644 index 000000000..1b7958abc --- /dev/null +++ b/users/ninjonas/process_records.c | |||
| @@ -0,0 +1,98 @@ | |||
| 1 | #include "ninjonas.h" | ||
| 2 | |||
| 3 | __attribute__((weak)) | ||
| 4 | bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { return true; } | ||
| 5 | |||
| 6 | __attribute__((weak)) | ||
| 7 | bool process_record_secrets(uint16_t keycode, keyrecord_t *record) { return true; } | ||
| 8 | |||
| 9 | bool process_record_user(uint16_t keycode, keyrecord_t *record) { | ||
| 10 | if (record->event.pressed) { | ||
| 11 | #ifdef SSD1306OLED | ||
| 12 | set_keylog(keycode, record); | ||
| 13 | #endif | ||
| 14 | } | ||
| 15 | |||
| 16 | switch (keycode) { | ||
| 17 | |||
| 18 | // Sends pyenv to activate 'jira' environment | ||
| 19 | case M_PYNV: | ||
| 20 | if (record->event.pressed) { | ||
| 21 | SEND_STRING("pyenv activate jira" SS_TAP(X_ENTER)); | ||
| 22 | } | ||
| 23 | break; | ||
| 24 | |||
| 25 | // Sends + alt + shift to a keycode to activate shiftit. See: https://github.com/fikovnik/ShiftIt | ||
| 26 | case M_SHFT: | ||
| 27 | if (record->event.pressed) { | ||
| 28 | register_code(KC_LGUI); | ||
| 29 | register_code(KC_LALT); | ||
| 30 | register_code(KC_LCTL); | ||
| 31 | } else { | ||
| 32 | unregister_code(KC_LGUI); | ||
| 33 | unregister_code(KC_LALT); | ||
| 34 | unregister_code(KC_LCTL); | ||
| 35 | } | ||
| 36 | break; | ||
| 37 | |||
| 38 | // Sends QMK make command to compile keyboard | ||
| 39 | case M_MAKE: | ||
| 40 | if (record->event.pressed) { | ||
| 41 | SEND_STRING("rm -f *.hex && rm -rf .build/ && make " QMK_KEYBOARD ":" QMK_KEYMAP SS_TAP(X_ENTER)); | ||
| 42 | } | ||
| 43 | break; | ||
| 44 | |||
| 45 | // Sends QMK make command with the correct bootloader | ||
| 46 | case M_FLSH: | ||
| 47 | if (!record->event.pressed) { | ||
| 48 | SEND_STRING("rm -f *.hex && rm -rf .build/ && make " QMK_KEYBOARD ":" QMK_KEYMAP | ||
| 49 | #if (defined(BOOTLOADER_DFU) || defined(BOOTLOADER_LUFA_DFU) || defined(BOOTLOADER_QMK_DFU)) | ||
| 50 | ":dfu " | ||
| 51 | #elif defined(BOOTLOADER_CATERINA) | ||
| 52 | ":avrdude " | ||
| 53 | #endif | ||
| 54 | SS_TAP(X_ENTER) | ||
| 55 | ); | ||
| 56 | |||
| 57 | // Send reset_keyboard command instead of pressing reset button | ||
| 58 | #if (defined(BOOTLOADER_DFU) || defined(BOOTLOADER_LUFA_DFU) || defined(BOOTLOADER_QMK_DFU)) | ||
| 59 | reset_keyboard(); | ||
| 60 | #endif | ||
| 61 | } | ||
| 62 | break; | ||
| 63 | |||
| 64 | // Sends QMK version | ||
| 65 | case M_VRSN: | ||
| 66 | if (record->event.pressed) { | ||
| 67 | SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION ", Built on: " QMK_BUILDDATE); | ||
| 68 | } | ||
| 69 | break; | ||
| 70 | |||
| 71 | // Opens Visual Studio Code on current directory | ||
| 72 | case M_CODE: | ||
| 73 | if (record->event.pressed) { | ||
| 74 | SEND_STRING("code ." SS_TAP(X_ENTER)); | ||
| 75 | } | ||
| 76 | break; | ||
| 77 | |||
| 78 | // BEGIN: Layer macros | ||
| 79 | case QWERTY: | ||
| 80 | if (record->event.pressed) { | ||
| 81 | set_single_persistent_default_layer(_QWERTY); | ||
| 82 | } | ||
| 83 | break; | ||
| 84 | case DVORAK: | ||
| 85 | if (record->event.pressed) { | ||
| 86 | set_single_persistent_default_layer(_DVORAK); | ||
| 87 | } | ||
| 88 | break; | ||
| 89 | case COLEMAK: | ||
| 90 | if (record->event.pressed) { | ||
| 91 | set_single_persistent_default_layer(_COLEMAK); | ||
| 92 | } | ||
| 93 | break; | ||
| 94 | // END: Layer macros | ||
| 95 | } | ||
| 96 | |||
| 97 | return process_record_keymap(keycode, record) && process_record_secrets(keycode, record); | ||
| 98 | } | ||
diff --git a/users/ninjonas/process_records.h b/users/ninjonas/process_records.h new file mode 100644 index 000000000..6db1d91fb --- /dev/null +++ b/users/ninjonas/process_records.h | |||
| @@ -0,0 +1,24 @@ | |||
| 1 | #pragma once | ||
| 2 | #include "ninjonas.h" | ||
| 3 | |||
| 4 | enum custom_keycodes { | ||
| 5 | // Layer Macros | ||
| 6 | QWERTY = SAFE_RANGE, | ||
| 7 | DVORAK, | ||
| 8 | COLEMAK, | ||
| 9 | // Custom Macros | ||
| 10 | M_ZOOM, | ||
| 11 | M_PYNV, | ||
| 12 | M_SHFT, | ||
| 13 | M_MAKE, | ||
| 14 | M_FLSH, | ||
| 15 | M_VRSN, | ||
| 16 | M_CODE, | ||
| 17 | }; | ||
| 18 | |||
| 19 | #ifdef SSD1306OLED | ||
| 20 | void set_keylog(uint16_t keycode, keyrecord_t *record); | ||
| 21 | #endif | ||
| 22 | |||
| 23 | bool process_record_secrets(uint16_t keycode, keyrecord_t *record); | ||
| 24 | bool process_record_keymap(uint16_t keycode, keyrecord_t *record); | ||
diff --git a/users/ninjonas/rules.mk b/users/ninjonas/rules.mk new file mode 100644 index 000000000..1f2697a0e --- /dev/null +++ b/users/ninjonas/rules.mk | |||
| @@ -0,0 +1,18 @@ | |||
| 1 | BOOTMAGIC_ENABLE = no # Disable Boot Magic (https://beta.docs.qmk.fm/features/feature_bootmagic) | ||
| 2 | MOUSEKEY_ENABLE = yes # Mouse keys(+4700) | ||
| 3 | EXTRAKEY_ENABLE = yes # Audio control and System control(+450) | ||
| 4 | TAP_DANCE_ENABLE = yes # Enable Tap Dance. | ||
| 5 | |||
| 6 | Link_Time_Optimization = no # if firmware size over limit, try this option | ||
| 7 | |||
| 8 | ifeq ($(strip $(Link_Time_Optimization)),yes) | ||
| 9 | EXTRAFLAGS += -flto -DUSE_Link_Time_Optimization | ||
| 10 | endif | ||
| 11 | |||
| 12 | SRC += ninjonas.c \ | ||
| 13 | process_records.c \ | ||
| 14 | tap_dances.c | ||
| 15 | |||
| 16 | ifneq ("$(wildcard $(USER_PATH)/secrets.c)","") | ||
| 17 | SRC += secrets.c | ||
| 18 | endif \ No newline at end of file | ||
diff --git a/users/ninjonas/tap_dances.c b/users/ninjonas/tap_dances.c new file mode 100644 index 000000000..0665a1607 --- /dev/null +++ b/users/ninjonas/tap_dances.c | |||
| @@ -0,0 +1,12 @@ | |||
| 1 | #include "ninjonas.h" | ||
| 2 | |||
| 3 | qk_tap_dance_action_t tap_dance_actions[] = { | ||
| 4 | [TD_ESC_CAPS] = ACTION_TAP_DANCE_DOUBLE(KC_ESC, KC_CAPS), | ||
| 5 | [TD_LBRC_BACK] = ACTION_TAP_DANCE_DOUBLE(KC_LBRC, LGUI(KC_LBRC)), | ||
| 6 | [TD_RBRC_FWD] = ACTION_TAP_DANCE_DOUBLE(KC_RBRC, LGUI(KC_RBRC)), | ||
| 7 | [TD_TAB_CTRLTAB] = ACTION_TAP_DANCE_DOUBLE(KC_TAB, LCTL(KC_TAB)), | ||
| 8 | [TD_GRV_CTRLGRV] = ACTION_TAP_DANCE_DOUBLE(KC_GRV, LGUI(KC_GRV)), | ||
| 9 | [TD_GUI_GUISPC] = ACTION_TAP_DANCE_DOUBLE(KC_LGUI, LGUI(KC_SPC)), | ||
| 10 | [TD_W_CTRLW] = ACTION_TAP_DANCE_DOUBLE(KC_W, LGUI(KC_W)), | ||
| 11 | [TD_Q_GUIQ] = ACTION_TAP_DANCE_DOUBLE(KC_Q, LGUI(KC_Q)), | ||
| 12 | }; \ No newline at end of file | ||
diff --git a/users/ninjonas/tap_dances.h b/users/ninjonas/tap_dances.h new file mode 100644 index 000000000..0a781ce4e --- /dev/null +++ b/users/ninjonas/tap_dances.h | |||
| @@ -0,0 +1,22 @@ | |||
| 1 | #pragma once | ||
| 2 | #include "ninjonas.h" | ||
| 3 | |||
| 4 | enum custom_tapdances{ | ||
| 5 | TD_ESC_CAPS = 0, | ||
| 6 | TD_LBRC_BACK, | ||
| 7 | TD_RBRC_FWD, | ||
| 8 | TD_TAB_CTRLTAB, | ||
| 9 | TD_GRV_CTRLGRV, | ||
| 10 | TD_GUI_GUISPC, | ||
| 11 | TD_W_CTRLW, | ||
| 12 | TD_Q_GUIQ, | ||
| 13 | }; | ||
| 14 | |||
| 15 | #define T_ESC TD(TD_ESC_CAPS) // Tap for ESC, double tap for CAPSLOCK | ||
| 16 | #define T_LBRC TD(TD_LBRC_BACK) // Tap for [, double tap for back browser | ||
| 17 | #define T_RBRC TD(TD_RBRC_FWD) // Tap for ], double tap for forward browser | ||
| 18 | #define T_TAB TD(TD_TAB_CTRLTAB) // Tap for TAB, double tap for CTRL + TAB | ||
| 19 | #define T_GRV TD(TD_GRV_CTRLGRV) // Tap for GRV, double tap for + GRV | ||
| 20 | #define T_GUI TD(TD_GUI_GUISPC) // Tap for , double tap for + Space | ||
| 21 | #define T_W TD(TD_W_CTRLW) // Tap for W, double tap for + W | ||
| 22 | #define T_Q TD(TD_Q_GUIQ) // Tap for Q, double tap for + Q \ No newline at end of file | ||
