diff options
| author | ishtob <ishtob@gmail.com> | 2018-08-10 11:30:21 -0400 |
|---|---|---|
| committer | Drashna Jaelre <drashna@live.com> | 2018-08-10 08:30:21 -0700 |
| commit | fd0bd29a0a3f2de93a3e561007805fac67e7e0cd (patch) | |
| tree | d7c9a379d6b04fb851854102631cdde5c3f9b607 /users/ishtob | |
| parent | feb5e4aaebb78842c090230f68ea9de80a5c17e6 (diff) | |
| download | qmk_firmware-fd0bd29a0a3f2de93a3e561007805fac67e7e0cd.tar.gz qmk_firmware-fd0bd29a0a3f2de93a3e561007805fac67e7e0cd.zip | |
Keymap: adding my personal userspace to QMK master (#3605)
* Adding my personal planck keymap
* Adding readme.md to my keymap
* Create my userspace
add users/ishtob/
* Moved macros off keymap
macros now exsists in my userspace, moved them off keyboard specific keymaps
* Create my userspace
add users/ishtob/
* rebase from main QMK repo
Diffstat (limited to 'users/ishtob')
| -rwxr-xr-x | users/ishtob/config.h | 76 | ||||
| -rw-r--r-- | users/ishtob/ishtob.c | 69 | ||||
| -rw-r--r-- | users/ishtob/ishtob.h | 76 | ||||
| -rw-r--r-- | users/ishtob/readme.md | 87 | ||||
| -rwxr-xr-x | users/ishtob/rules.mk | 7 |
5 files changed, 315 insertions, 0 deletions
diff --git a/users/ishtob/config.h b/users/ishtob/config.h new file mode 100755 index 000000000..9c4a7ed8d --- /dev/null +++ b/users/ishtob/config.h | |||
| @@ -0,0 +1,76 @@ | |||
| 1 | #ifndef CONFIG_USER_H | ||
| 2 | #define CONFIG_USER_H | ||
| 3 | |||
| 4 | #include "config_common.h" | ||
| 5 | |||
| 6 | #ifdef AUDIO_ENABLE | ||
| 7 | #define STARTUP_SONG SONG(PLANCK_SOUND) | ||
| 8 | // #define STARTUP_SONG SONG(NO_SOUND) | ||
| 9 | |||
| 10 | #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ | ||
| 11 | SONG(COLEMAK_SOUND), \ | ||
| 12 | SONG(DVORAK_SOUND) \ | ||
| 13 | } | ||
| 14 | #endif | ||
| 15 | |||
| 16 | //#define LEADER_TIMEOUT 300 | ||
| 17 | //#define BACKLIGHT_BREATHING | ||
| 18 | #define PREVENT_STUCK_MODIFIERS | ||
| 19 | //#define PERMISSIVE_HOLD | ||
| 20 | // #define QMK_KEYS_PER_SCAN 4 | ||
| 21 | |||
| 22 | //audio clicky | ||
| 23 | //#define AUDIO_CLICKY | ||
| 24 | // to enable clicky on startup | ||
| 25 | //#define AUDIO_CLICKY_ON | ||
| 26 | //#define AUDIO_CLICKY_FREQ_RANDOMNESS 1.0f | ||
| 27 | |||
| 28 | /* ws2812 RGB LED | ||
| 29 | #define RGB_DI_PIN B5 | ||
| 30 | #define RGBLIGHT_ANIMATIONS | ||
| 31 | #define RGBLED_NUM 8 // Number of LEDs | ||
| 32 | #define RGBLIGHT_HUE_STEP 10 | ||
| 33 | #define RGBLIGHT_SAT_STEP 17 | ||
| 34 | */ | ||
| 35 | #undef PLANCK_MIT_LAYOUT | ||
| 36 | |||
| 37 | //#define MUON_LEFT | ||
| 38 | |||
| 39 | #undef DEBOUNCE | ||
| 40 | #define DEBOUNCE 0 | ||
| 41 | |||
| 42 | //rgb-reactive | ||
| 43 | //#define RGB_MATRIX_KEYPRESSES | ||
| 44 | //#define EECONFIG_RGB_MATRIX (uint32_t *)16 | ||
| 45 | |||
| 46 | //skip usb startup check | ||
| 47 | //#define NO_USB_STARTUP_CHECK | ||
| 48 | |||
| 49 | |||
| 50 | /* | ||
| 51 | * MIDI options | ||
| 52 | */ | ||
| 53 | |||
| 54 | /* Prevent use of disabled MIDI features in the keymap */ | ||
| 55 | //#define MIDI_ENABLE_STRICT 1 | ||
| 56 | |||
| 57 | /* enable basic MIDI features: | ||
| 58 | - MIDI notes can be sent when in Music mode is on | ||
| 59 | */ | ||
| 60 | #define MIDI_BASIC | ||
| 61 | |||
| 62 | /* enable advanced MIDI features: | ||
| 63 | - MIDI notes can be added to the keymap | ||
| 64 | - Octave shift and transpose | ||
| 65 | - Virtual sustain, portamento, and modulation wheel | ||
| 66 | - etc. | ||
| 67 | */ | ||
| 68 | //#define MIDI_ADVANCED | ||
| 69 | |||
| 70 | /* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ | ||
| 71 | //#define MIDI_TONE_KEYCODE_OCTAVES 2 | ||
| 72 | |||
| 73 | // Most tactile encoders have detents every 4 stages | ||
| 74 | #define ENCODER_RESOLUTION 4 | ||
| 75 | |||
| 76 | #endif | ||
diff --git a/users/ishtob/ishtob.c b/users/ishtob/ishtob.c new file mode 100644 index 000000000..1b847d630 --- /dev/null +++ b/users/ishtob/ishtob.c | |||
| @@ -0,0 +1,69 @@ | |||
| 1 | /* | ||
| 2 | Based on userspace written by @drashna 2017 | ||
| 3 | Copyright 2018 Hsian Chang <ishtob@gmail.com> @ishtob | ||
| 4 | |||
| 5 | This program is free software: you can redistribute it and/or modify | ||
| 6 | it under the terms of the GNU General Public License as published by | ||
| 7 | the Free Software Foundation, either version 2 of the License, or | ||
| 8 | (at your option) any later version. | ||
| 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 | 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 | |||
| 17 | #include "ishtob.h" | ||
| 18 | #include "action.h" | ||
| 19 | #include "action_layer.h" | ||
| 20 | // #include "dynamic_macro.h" | ||
| 21 | #ifdef AUDIO_ENABLE | ||
| 22 | #include "audio.h" | ||
| 23 | #endif | ||
| 24 | |||
| 25 | |||
| 26 | // Add reconfigurable functions here, for keymap customization | ||
| 27 | // This allows for a global, userspace functions, and continued | ||
| 28 | // customization of the keymap. Use _keymap instead of _user | ||
| 29 | // functions in the keymaps | ||
| 30 | __attribute__ ((weak)) | ||
| 31 | void matrix_init_keymap(void) {} | ||
| 32 | |||
| 33 | __attribute__ ((weak)) | ||
| 34 | void matrix_scan_keymap(void) {} | ||
| 35 | |||
| 36 | __attribute__ ((weak)) | ||
| 37 | bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { | ||
| 38 | return true; | ||
| 39 | } | ||
| 40 | |||
| 41 | __attribute__ ((weak)) | ||
| 42 | bool process_record_secrets(uint16_t keycode, keyrecord_t *record) { | ||
| 43 | return true; | ||
| 44 | } | ||
| 45 | |||
| 46 | // Call user matrix init, then call the keymap's init function | ||
| 47 | void matrix_init_user(void) { | ||
| 48 | matrix_init_keymap(); | ||
| 49 | } | ||
| 50 | |||
| 51 | // No global matrix scan code, so just run keymap's matix | ||
| 52 | // scan function | ||
| 53 | void matrix_scan_user(void) { | ||
| 54 | matrix_scan_keymap(); | ||
| 55 | } | ||
| 56 | |||
| 57 | bool process_record_user(uint16_t keycode, keyrecord_t *record) { | ||
| 58 | switch (keycode) { | ||
| 59 | case DFU: | ||
| 60 | if (record->event.pressed) { | ||
| 61 | clear_keyboard(); | ||
| 62 | reset_keyboard(); | ||
| 63 | } | ||
| 64 | return false; | ||
| 65 | break; | ||
| 66 | } | ||
| 67 | return process_record_keymap(keycode, record) && process_record_secrets(keycode, record); | ||
| 68 | } | ||
| 69 | |||
diff --git a/users/ishtob/ishtob.h b/users/ishtob/ishtob.h new file mode 100644 index 000000000..2c47fce79 --- /dev/null +++ b/users/ishtob/ishtob.h | |||
| @@ -0,0 +1,76 @@ | |||
| 1 | #ifndef USERSPACE | ||
| 2 | #define USERSPACE | ||
| 3 | #include "quantum.h" | ||
| 4 | |||
| 5 | enum userspace_keycodes { | ||
| 6 | QWERTY = SAFE_RANGE, | ||
| 7 | COLEMAK, | ||
| 8 | DVORAK, | ||
| 9 | PLOVER, | ||
| 10 | LOWER, | ||
| 11 | RAISE, | ||
| 12 | BACKLIT, | ||
| 13 | EXT_PLV, | ||
| 14 | DFU, | ||
| 15 | P_CITRIX, //these macro exsists in macros_private.c, which is excluded from git | ||
| 16 | P_MPASS, | ||
| 17 | P_META, | ||
| 18 | O_DAYRN, | ||
| 19 | O_RTQ6H, | ||
| 20 | O_3DRN, | ||
| 21 | O_AUTODC, | ||
| 22 | M_EMAIL, | ||
| 23 | M_EMAIL2 | ||
| 24 | }; | ||
| 25 | |||
| 26 | // Each layer gets a name for readability, which is then used in the keymap matrix below. | ||
| 27 | // The underscores don't mean anything - you can have a layer called STUFF or any other name. | ||
| 28 | // Layer names don't all need to be of the same length, obviously, and you can also skip them | ||
| 29 | // entirely and just use numbers. | ||
| 30 | #define _QWERTY 0 | ||
| 31 | #define _COLEMAK 1 | ||
| 32 | #define _DVORAK 2 | ||
| 33 | #define _LOWER 3 | ||
| 34 | #define _RAISE 4 | ||
| 35 | #define _PLOVER 5 | ||
| 36 | #define _FNLAYER 6 | ||
| 37 | #define _NUMLAY 7 | ||
| 38 | #define _MOUSECURSOR 8 | ||
| 39 | #define _ADJUST 16 | ||
| 40 | |||
| 41 | |||
| 42 | |||
| 43 | #define LOWER MO(_LOWER) | ||
| 44 | #define RAISE MO(_RAISE) | ||
| 45 | |||
| 46 | // Fillers to make layering more clear | ||
| 47 | #define _______ KC_TRNS | ||
| 48 | #define XXXXXXX KC_NO | ||
| 49 | // Custom macros | ||
| 50 | #define CTL_ESC CTL_T(KC_ESC) // Tap for Esc, hold for Ctrl | ||
| 51 | #define CTL_TTAB CTL_T(KC_TAB) // Tap for Esc, hold for Ctrl | ||
| 52 | #define CTL_ENT CTL_T(KC_ENT) // Tap for Enter, hold for Ctrl | ||
| 53 | #define SFT_ENT SFT_T(KC_ENT) // Tap for Enter, hold for Shift | ||
| 54 | // Requires KC_TRNS/_______ for the trigger key in the destination layer | ||
| 55 | #define LT_FN(kc) LT(_FNLAYER, kc) // L-ayer T-ap Function Layer | ||
| 56 | #define LT_MC(kc) LT(_MOUSECURSOR, kc) // L-ayer T-ap M-ouse C-ursor | ||
| 57 | #define LT_RAI(kc) LT(_RAISE, kc) // L-ayer T-ap to Raise | ||
| 58 | #define TG_NUMLAY TG(_NUMLAY) //Toggle for layer _NUMLAY | ||
| 59 | /* | ||
| 60 | enum userspace_layers { | ||
| 61 | _QWERTY = 0, | ||
| 62 | _COLEMAK, | ||
| 63 | _DVORAK, | ||
| 64 | _LOWER, | ||
| 65 | _RAISE, | ||
| 66 | _PLOVER, | ||
| 67 | _FNLAYER, | ||
| 68 | _NUMLAY, | ||
| 69 | _MOUSECURSOR, | ||
| 70 | _ADJUST | ||
| 71 | }; | ||
| 72 | */ | ||
| 73 | |||
| 74 | |||
| 75 | |||
| 76 | #endif // !USERSPACE \ No newline at end of file | ||
diff --git a/users/ishtob/readme.md b/users/ishtob/readme.md new file mode 100644 index 000000000..5b7064de9 --- /dev/null +++ b/users/ishtob/readme.md | |||
| @@ -0,0 +1,87 @@ | |||
| 1 | # Ishtob's userspace | ||
| 2 | |||
| 3 | under developement | ||
| 4 | |||
| 5 | # Secret Macros | ||
| 6 | |||
| 7 | This section is a modified version of what @drashna did in his userspace: https://github.com/qmk/qmk_firmware/tree/master/users/drashna#secret-macros | ||
| 8 | |||
| 9 | `macros_private.c` will be used if it exsists in the userspace folder during compiling. | ||
| 10 | |||
| 11 | To get started, put the following in rules.mk. this will have the compiler include the macros_private.c file if it exsists. | ||
| 12 | ``` | ||
| 13 | SRC += ishtob.c | ||
| 14 | ifneq ($(wildcard $(USER_PATH)/macros_private.c),"") | ||
| 15 | SRC += macros_private.c | ||
| 16 | endif | ||
| 17 | ifeq ($(strip $(NO_SECRETS)), yes) | ||
| 18 | OPT_DEFS += -DNO_SECRETS | ||
| 19 | endif | ||
| 20 | ``` | ||
| 21 | |||
| 22 | Remember that all macro keycode has to be present in the header file (ishtob.h) to prevent error during compile. | ||
| 23 | |||
| 24 | Next, you setup macros_private.c, ensure the keycodes are defined in ishtob.h (or your keymap.h). | ||
| 25 | Here is an example of my macros with the sensitive login information removed: | ||
| 26 | ``` | ||
| 27 | #include "ishtob.h" //replace this with your userspace or keymap | ||
| 28 | #include "quantum.h" | ||
| 29 | |||
| 30 | #pragma message "secret macros included" //debug line to let me know this file is included in the compile | ||
| 31 | |||
| 32 | //this str is for the monthly password rotation per my workplace's security policy | ||
| 33 | char my_str[5] = "stuff"; | ||
| 34 | |||
| 35 | bool process_record_secrets(uint16_t keycode, keyrecord_t *record) { | ||
| 36 | if (record->event.pressed) { | ||
| 37 | switch(keycode) { | ||
| 38 | //my login macros | ||
| 39 | case P_CITRIX: | ||
| 40 | SEND_STRING("username"SS_TAP(X_TAB)"something"); | ||
| 41 | send_string(my_str); | ||
| 42 | return false; | ||
| 43 | case P_MPASS: | ||
| 44 | SEND_STRING("something"); | ||
| 45 | send_string(my_str); | ||
| 46 | return false; | ||
| 47 | case P_META: | ||
| 48 | SEND_STRING("metausername"); | ||
| 49 | return false; | ||
| 50 | //my work macros for the meta application | ||
| 51 | case O_RTQ6H: | ||
| 52 | SEND_STRING(SS_TAP(X_TAB)"0300"SS_TAP(X_TAB)SS_TAP(X_DOWN)SS_TAP(X_TAB)"0900"SS_TAP(X_TAB)SS_TAP(X_DOWN)SS_TAP(X_TAB)"1500"SS_TAP(X_TAB)SS_TAP(X_DOWN)SS_TAP(X_TAB)"2100"SS_TAP(X_TAB)SS_LALT("o")); | ||
| 53 | return false; | ||
| 54 | case O_AUTODC: | ||
| 55 | SEND_STRING(SS_LALT("v")SS_TAP(X_TAB)SS_TAP(X_TAB)SS_TAP(X_TAB)SS_TAP(X_TAB)SS_TAP(X_TAB)SS_TAP(X_TAB)SS_TAP(X_TAB)SS_TAP(X_TAB)SS_TAP(X_TAB)"T"SS_TAP(X_TAB)"N"SS_LALT("s")); | ||
| 56 | return false; | ||
| 57 | case O_DAYRN: | ||
| 58 | SEND_STRING(SS_TAP(X_TAB)SS_TAP(X_TAB)SS_TAP(X_TAB)SS_TAP(X_TAB)SS_TAP(X_TAB)"1"SS_LALT("s")); | ||
| 59 | return false; | ||
| 60 | //Ops macros | ||
| 61 | case M_EMAIL: | ||
| 62 | SEND_STRING("privatemail@email.com"); | ||
| 63 | return false; | ||
| 64 | case M_EMAIL2: | ||
| 65 | SEND_STRING("workemail@work.com"); | ||
| 66 | return false; | ||
| 67 | } | ||
| 68 | } | ||
| 69 | return true; | ||
| 70 | } | ||
| 71 | ``` | ||
| 72 | |||
| 73 | |||
| 74 | Finally, add the following to .git/info/exclude to prevent private macros from being committed to git. | ||
| 75 | ``` | ||
| 76 | # git ls-files --others --exclude-from=.git/info/exclude | ||
| 77 | # Lines that start with '#' are comments. | ||
| 78 | # For a project mostly in C, the following would be a good set of | ||
| 79 | # exclude patterns (uncomment them if you want to use them): | ||
| 80 | # *.[oa] | ||
| 81 | # *~ | ||
| 82 | /users/ishtob/macros_private.c | ||
| 83 | ``` | ||
| 84 | |||
| 85 | # Special mentions | ||
| 86 | |||
| 87 | special thanks to @drashna for helping me through quite a bit of these codes. \ No newline at end of file | ||
diff --git a/users/ishtob/rules.mk b/users/ishtob/rules.mk new file mode 100755 index 000000000..d19e95266 --- /dev/null +++ b/users/ishtob/rules.mk | |||
| @@ -0,0 +1,7 @@ | |||
| 1 | SRC += ishtob.c | ||
| 2 | ifneq ($(wildcard $(USER_PATH)/macros_private.c),"") | ||
| 3 | SRC += macros_private.c | ||
| 4 | endif | ||
| 5 | ifeq ($(strip $(NO_SECRETS)), yes) | ||
| 6 | OPT_DEFS += -DNO_SECRETS | ||
| 7 | endif | ||
