diff options
| author | Matthew Lyon <matthew@lyonheart.us> | 2019-07-08 06:27:30 -0700 |
|---|---|---|
| committer | MechMerlin <30334081+mechmerlin@users.noreply.github.com> | 2019-07-08 06:27:30 -0700 |
| commit | 06ba968759041d8c6dfe1309888d21bdbc16cd24 (patch) | |
| tree | de550b10caa37eeb344bbb65e957e10f63cd419a /users/mattly | |
| parent | 75795186135e6d83de1ff3bb108f9c5471742ba4 (diff) | |
| download | qmk_firmware-06ba968759041d8c6dfe1309888d21bdbc16cd24.tar.gz qmk_firmware-06ba968759041d8c6dfe1309888d21bdbc16cd24.zip | |
mattly's userspace and iris (#6279)
Diffstat (limited to 'users/mattly')
| -rw-r--r-- | users/mattly/config.h | 9 | ||||
| -rw-r--r-- | users/mattly/mattly.c | 70 | ||||
| -rw-r--r-- | users/mattly/mattly.h | 83 | ||||
| -rw-r--r-- | users/mattly/readme.md | 10 | ||||
| -rw-r--r-- | users/mattly/rules.mk | 2 |
5 files changed, 174 insertions, 0 deletions
diff --git a/users/mattly/config.h b/users/mattly/config.h new file mode 100644 index 000000000..25d379801 --- /dev/null +++ b/users/mattly/config.h | |||
| @@ -0,0 +1,9 @@ | |||
| 1 | #pragma once | ||
| 2 | |||
| 3 | // Most tactile encoders have detents every 4 stages | ||
| 4 | #define ENCODER_RESOLUTION 4 | ||
| 5 | |||
| 6 | #define IGNORE_MOD_TAP_INTERRUPT | ||
| 7 | #define PERMISSIVE_HOLD | ||
| 8 | #define TAPPING_TOGGLE 2 | ||
| 9 | #define TAPPING_TERM 200 | ||
diff --git a/users/mattly/mattly.c b/users/mattly/mattly.c new file mode 100644 index 000000000..1e61e0126 --- /dev/null +++ b/users/mattly/mattly.c | |||
| @@ -0,0 +1,70 @@ | |||
| 1 | #include "mattly.h" | ||
| 2 | |||
| 3 | __attribute__ ((weak)) | ||
| 4 | layer_state_t layer_state_set_keymap (layer_state_t state) { | ||
| 5 | return state; | ||
| 6 | } | ||
| 7 | |||
| 8 | void set_lights_default(void) { | ||
| 9 | #ifdef RGBLIGHT_ENABLE | ||
| 10 | if (IS_HOST_LED_ON(USB_LED_CAPS_LOCK)) { | ||
| 11 | rgblight_sethsv_noeeprom(HSV_CAPS); | ||
| 12 | } else { | ||
| 13 | rgblight_sethsv_noeeprom(HSV_DEFAULT); | ||
| 14 | } | ||
| 15 | #endif | ||
| 16 | } | ||
| 17 | |||
| 18 | void layer_state_set_rgb(layer_state_t state) { | ||
| 19 | #ifdef RGBLIGHT_ENABLE | ||
| 20 | switch (biton32(state)) { | ||
| 21 | case _QWERTY: | ||
| 22 | set_lights_default(); | ||
| 23 | break; | ||
| 24 | case _SYMBOL: | ||
| 25 | rgblight_sethsv_noeeprom(HSV_SYMBOL); | ||
| 26 | break; | ||
| 27 | case _NAVNUM: | ||
| 28 | rgblight_sethsv_noeeprom(HSV_NAVNUM); | ||
| 29 | break; | ||
| 30 | case _FUNCT: | ||
| 31 | rgblight_sethsv_noeeprom(HSV_FUNCT); | ||
| 32 | break; | ||
| 33 | } | ||
| 34 | #endif | ||
| 35 | } | ||
| 36 | |||
| 37 | |||
| 38 | layer_state_t layer_state_set_user (layer_state_t state) { | ||
| 39 | state = update_tri_layer_state(state, _SYMBOL, _NAVNUM, _FUNCT); | ||
| 40 | layer_state_set_rgb(state); | ||
| 41 | return layer_state_set_keymap (state); | ||
| 42 | } | ||
| 43 | |||
| 44 | void on_reset(void) { | ||
| 45 | #ifdef RGBLIGHT_ENABLE | ||
| 46 | rgblight_sethsv_noeeprom(HSV_RESET); | ||
| 47 | #endif | ||
| 48 | } | ||
| 49 | |||
| 50 | bool process_record_user(uint16_t keycode, keyrecord_t *record) { | ||
| 51 | switch (keycode) { | ||
| 52 | case KC_CAPS: | ||
| 53 | #ifdef RGBLIGHT_ENABLE | ||
| 54 | set_lights_default(); | ||
| 55 | #endif | ||
| 56 | return true; | ||
| 57 | case RESET: | ||
| 58 | on_reset(); | ||
| 59 | return true; | ||
| 60 | default: | ||
| 61 | return true; | ||
| 62 | } | ||
| 63 | } | ||
| 64 | |||
| 65 | void keyboard_post_init_user(void) { | ||
| 66 | #ifdef RGBLIGHT_ENABLE | ||
| 67 | rgblight_enable_noeeprom(); | ||
| 68 | set_lights_default(); | ||
| 69 | #endif | ||
| 70 | } | ||
diff --git a/users/mattly/mattly.h b/users/mattly/mattly.h new file mode 100644 index 000000000..08318840d --- /dev/null +++ b/users/mattly/mattly.h | |||
| @@ -0,0 +1,83 @@ | |||
| 1 | /* Copyright 2019 Matthew Lyon | ||
| 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 | |||
| 17 | #ifndef USERSPACE | ||
| 18 | #define USERSPACE | ||
| 19 | |||
| 20 | #include "quantum.h" | ||
| 21 | |||
| 22 | enum { | ||
| 23 | _QWERTY, | ||
| 24 | _NAVNUM, | ||
| 25 | _SYMBOL, | ||
| 26 | _FUNCT, | ||
| 27 | }; | ||
| 28 | |||
| 29 | // left hand | ||
| 30 | #define ESC_HYP MT(MOD_HYPR, KC_ESC) | ||
| 31 | #define BSP_NUM LT(_NAVNUM, KC_BSPC) | ||
| 32 | #define ENT_SFT MT(MOD_LSFT, KC_ENT) | ||
| 33 | #define SPC_SFT MT(MOD_LSFT, KC_SPC) | ||
| 34 | |||
| 35 | // right hand | ||
| 36 | #define SPC_SFT MT(MOD_LSFT, KC_SPC) | ||
| 37 | #define TAB_SYM LT(_SYMBOL, KC_TAB) | ||
| 38 | #define DEL_WRP MT(MOD_LCTL | MOD_LALT | MOD_LGUI, KC_DEL) | ||
| 39 | |||
| 40 | #define NAVLOCK TG(_NAVNUM) | ||
| 41 | #define SYMLOCK TG(_SYMBOL) | ||
| 42 | |||
| 43 | |||
| 44 | // QWERTY | ||
| 45 | |||
| 46 | #define A_CTRL MT(MOD_LCTL, KC_A) | ||
| 47 | #define S_ALT MT(MOD_LALT, KC_S) | ||
| 48 | #define D_GUI MT(MOD_LGUI, KC_D) | ||
| 49 | #define F_SHFT MT(MOD_LSFT, KC_F) | ||
| 50 | #define J_SHFT MT(MOD_RSFT, KC_J) | ||
| 51 | #define K_GUI MT(MOD_RGUI, KC_K) | ||
| 52 | #define L_ALT MT(MOD_RALT, KC_L) | ||
| 53 | #define MINSCTL MT(MOD_RCTL, KC_MINS) | ||
| 54 | |||
| 55 | #define BWORD LALT(KC_LEFT) | ||
| 56 | #define FWORD LALT(KC_RIGHT) | ||
| 57 | |||
| 58 | // OS X default keys | ||
| 59 | #define NWIN LGUI(KC_GRV) // Next Window | ||
| 60 | #define PWIN LGUI(LSFT(KC_GRV)) // Prev Window | ||
| 61 | #define NTAB LGUI(LSFT(KC_RBRC)) // Next Tab | ||
| 62 | #define PTAB LGUI(LSFT(KC_LBRC)) // Prev Tab | ||
| 63 | #define NAVBACK LGUI(KC_LBRC) // Navigate Forward | ||
| 64 | #define NAVFWD LGUI(KC_RBRC) // Navigate Back | ||
| 65 | |||
| 66 | // my personal mappings to window manager commands | ||
| 67 | #define XALLWIN HYPR(KC_F14) | ||
| 68 | #define XDESKTP HYPR(KC_F15) | ||
| 69 | #define XNXTSPC HYPR(KC_F16) | ||
| 70 | #define XPRVSPC HYPR(KC_F17) | ||
| 71 | #define XNOTIFY HYPR(KC_F18) | ||
| 72 | |||
| 73 | #ifdef RGBLIGHT_ENABLE | ||
| 74 | #define HSV_CAPS 42, 255, 255 | ||
| 75 | #define HSV_DEFAULT 30, 218, 255 | ||
| 76 | #define HSV_SYMBOL 22, 255, 255 | ||
| 77 | #define HSV_NAVNUM 245, 200, 255 | ||
| 78 | #define HSV_FUNCT 233, 255, 255 | ||
| 79 | #define HSV_RESET 180, 255, 255 | ||
| 80 | #endif | ||
| 81 | |||
| 82 | #endif | ||
| 83 | |||
diff --git a/users/mattly/readme.md b/users/mattly/readme.md new file mode 100644 index 000000000..356992534 --- /dev/null +++ b/users/mattly/readme.md | |||
| @@ -0,0 +1,10 @@ | |||
| 1 | # mattly's layouts | ||
| 2 | |||
| 3 | My layouts are based around: | ||
| 4 | |||
| 5 | * making the most from small layouts on keyboards like the iris or planck | ||
| 6 | * moving held-modifiers from pinkies to thumbs or home row, giving many keys dual purposes via mod/layer taps | ||
| 7 | * easy home-row navigation on a layer, using standard keys, available to all programs, not just a specially-configured editor | ||
| 8 | * easy access to punctuation symbols used in the programming languages I work in | ||
| 9 | |||
| 10 | [Here is an image](https://lyonheart.us/etc/mattly-keymap.png) with an outdated description of my keymap \ No newline at end of file | ||
diff --git a/users/mattly/rules.mk b/users/mattly/rules.mk new file mode 100644 index 000000000..6803d361d --- /dev/null +++ b/users/mattly/rules.mk | |||
| @@ -0,0 +1,2 @@ | |||
| 1 | SRC += mattly.c | ||
| 2 | MOUSEKEY_ENABLE = yes | ||
