aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Gilbert <mattir@users.noreply.github.com>2021-01-25 23:59:21 -0500
committerGitHub <noreply@github.com>2021-01-25 20:59:21 -0800
commit7e8d97f8f05288dd6fe7fd2d8943bb27fc3f3117 (patch)
treedf16c3efdddf59fcf75b110318e550d5cfc37397
parent0e7e52c8202701e6a246fa8a6ac13dd2ecad5743 (diff)
downloadqmk_firmware-7e8d97f8f05288dd6fe7fd2d8943bb27fc3f3117.tar.gz
qmk_firmware-7e8d97f8f05288dd6fe7fd2d8943bb27fc3f3117.zip
[Keymap] Add 'mattir' keymap for the Kyria keyboard (#11428)
* First version of keymap * cleaned up code, made some tweaks, added readme * extended oled timeout * resolved final issues, all features functional * added some leader-key combos * added missing RGB keys to layout diagram * removed lines for older elite-c v3 * make filename lowercase * add old update interval * fix spacing
-rw-r--r--keyboards/kyria/keymaps/mattir/config.h55
-rw-r--r--keyboards/kyria/keymaps/mattir/keymap.c291
-rw-r--r--keyboards/kyria/keymaps/mattir/readme.md141
-rw-r--r--keyboards/kyria/keymaps/mattir/rules.mk4
4 files changed, 491 insertions, 0 deletions
diff --git a/keyboards/kyria/keymaps/mattir/config.h b/keyboards/kyria/keymaps/mattir/config.h
new file mode 100644
index 000000000..2c71428a9
--- /dev/null
+++ b/keyboards/kyria/keymaps/mattir/config.h
@@ -0,0 +1,55 @@
1/* Copyright 2019 Thomas Baart <thomas@splitkb.com>
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#pragma once
18
19#ifdef OLED_DRIVER_ENABLE
20# define OLED_DISPLAY_128X64
21# define OLED_TIMEOUT 300000
22# define OLED_UPDATE_INTERVAL 30
23#endif
24
25#ifdef RGBLIGHT_ENABLE
26# define RGBLIGHT_LIMIT_VAL 150
27# define RGBLIGHT_ANIMATIONS
28# define RGBLIGHT_HUE_STEP 8
29# define RGBLIGHT_SAT_STEP 8
30# define RGBLIGHT_VAL_STEP 8
31# define RGBLIGHT_SLEEP
32#endif
33
34// If you are using an Elite C rev3 on the slave side, uncomment the lines below:
35//#define SPLIT_USB_DETECT
36//#define NO_USB_STARTUP_CHECK
37
38// Set the layer toggle to only need 2 clicks instead of 5
39#define TAPPING_TOGGLE 2
40
41// EC11K encoders have a different resolution than other EC11 encoders.
42#define ENCODER_RESOLUTION 2
43
44// The Leader key allows to flexibly assign macros to key sequences.
45#define LEADER_PER_KEY_TIMING
46#define LEADER_TIMEOUT 350
47
48#define TAPPING_TERM 200
49
50// Allows to use either side as the master. Look at the documentation for info:
51// https://docs.qmk.fm/#/config_options?id=setting-handedness
52#define EE_HANDS
53
54// Allows media codes to properly register in macros and rotary encoder code
55#define TAP_CODE_DELAY 10
diff --git a/keyboards/kyria/keymaps/mattir/keymap.c b/keyboards/kyria/keymaps/mattir/keymap.c
new file mode 100644
index 000000000..81a9e1eeb
--- /dev/null
+++ b/keyboards/kyria/keymaps/mattir/keymap.c
@@ -0,0 +1,291 @@
1/* Copyright 2020 Matthew Gilbert <hello+github@mattir.com>
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 QMK_KEYBOARD_H
17
18enum layers {
19 QWERTY = 0,
20 LOWER,
21 RAISE,
22 FUNCS,
23 RGBLED
24};
25
26const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
27 [QWERTY] = LAYOUT(
28 KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS,
29 KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT,
30 KC_LEAD, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_GRV, XXXXXXX, XXXXXXX, KC_MINS, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_QUOT,
31 KC_MUTE, KC_LCTL, KC_LGUI, TT(RAISE), SFT_T(KC_SPC), SFT_T(KC_SPC), TT(LOWER), KC_BSPC, KC_LALT, TG(RGBLED)
32 ),
33 [LOWER] = LAYOUT(
34 _______, KC_EXLM, KC_AT, KC_HASH, KC_LCBR, KC_RCBR, _______, _______, _______, _______, _______, _______,
35 _______, KC_DLR, KC_PERC, KC_CIRC, KC_LPRN, KC_RPRN, KC_EQL, KC_PLUS, KC_MINS, KC_ASTR, KC_SLSH, _______,
36 TG(FUNCS), KC_AMPR, _______, _______, KC_LBRC, KC_RBRC, _______, XXXXXXX, XXXXXXX, _______, _______, _______, KC_COMM, KC_DOT, _______, _______,
37 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
38 ),
39 [RAISE] = LAYOUT(
40 _______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______,
41 _______, _______, KC_MPRV, KC_MPLY, KC_MNXT, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, _______, _______,
42 _______, _______, KC_BTN1, KC_BTN3, KC_BTN2, _______, _______, XXXXXXX, XXXXXXX, _______, KC_MS_L, KC_MS_D, KC_MS_U, KC_MS_R, _______, _______,
43 _______, _______, _______, _______, _______, _______, _______, KC_DEL, _______, _______
44 ),
45 [FUNCS] = LAYOUT(
46 _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_PPLS, KC_P7, KC_P8, KC_P9, KC_PAST, _______,
47 _______, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_PMNS, KC_P4, KC_P5, KC_P6, KC_PSLS, _______,
48 TG(FUNCS), KC_F11, KC_F12, _______, _______, _______, _______, XXXXXXX, XXXXXXX, _______, KC_P0, KC_P1, KC_P2, KC_P3, KC_PDOT, KC_PEQL,
49 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
50 ),
51 [RGBLED] = LAYOUT(
52 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
53 _______, _______, RGB_VAI, RGB_HUI, RGB_SAI, RGB_MOD, _______, _______, _______, _______, _______, _______,
54 _______, _______, RGB_VAD, RGB_HUD, RGB_SAD, RGB_RMOD, _______, XXXXXXX, XXXXXXX, _______, _______, _______, _______, _______, _______, _______,
55 RGB_TOG, _______, _______, _______, _______, _______, _______, _______, _______, TG(RGBLED)
56 ),
57};
58
59bool is_cmd_tab_active = false;
60uint16_t cmd_tab_timer = 0;
61
62LEADER_EXTERNS();
63
64void matrix_scan_user(void) {
65 if (is_cmd_tab_active) {
66 if (timer_elapsed(cmd_tab_timer) > 1000) {
67 unregister_code(KC_LGUI);
68 is_cmd_tab_active = false;
69 }
70 }
71
72 LEADER_DICTIONARY() {
73 leading = false;
74 leader_end();
75
76 SEQ_ONE_KEY(KC_A) {
77 tap_code16(SGUI(KC_L));
78 }
79 SEQ_TWO_KEYS(KC_S, KC_S) {
80 tap_code16(SGUI(KC_5));
81 }
82 }
83}
84
85#ifdef OLED_DRIVER_ENABLE
86oled_rotation_t oled_init_user(oled_rotation_t rotation) {
87 return OLED_ROTATION_180;
88}
89
90static void render_mattir_logo(void) {
91 static const char PROGMEM mattir_logo[] = {
92 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x3c, 0xfc, 0xf8, 0xe0,
93 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
94 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xe0, 0xe0, 0xc0,
95 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
96 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
97 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
98 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
99 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
100 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0x83, 0x07,
101 0x1f, 0x7e, 0xf8, 0xe0, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
102 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xf0, 0xf8, 0xfe, 0x3f, 0x1f, 0x7f, 0xff,
103 0xfc, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
104 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
105 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
106 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
107 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
108 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xff, 0xfc, 0xf8, 0x1c, 0x0f, 0x07, 0x00,
109 0x00, 0x00, 0x01, 0x07, 0x1f, 0x7e, 0xf8, 0xe0, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
110 0x00, 0x00, 0x00, 0x80, 0xe0, 0xf0, 0xfc, 0x7f, 0x1f, 0x0f, 0x03, 0x00, 0x00, 0x00, 0x00, 0x0f,
111 0xff, 0xff, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
112 0x00, 0xc0, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x80, 0x00,
113 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
114 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
115 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
116 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xfe, 0xff, 0x3f, 0x01, 0x00, 0x00, 0x00, 0x00,
117 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x07, 0x1f, 0x7f, 0xfc, 0xf0, 0xc0, 0x00, 0x00, 0x80,
118 0xe0, 0xf8, 0xfe, 0x3f, 0x0f, 0x07, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
119 0x01, 0x3f, 0xff, 0xfe, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0,
120 0xfe, 0xff, 0x7f, 0xfc, 0xf0, 0xc0, 0x00, 0x00, 0x00, 0x80, 0xe0, 0xfc, 0x7f, 0xff, 0xff, 0xe0,
121 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xc0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xc0, 0xe0, 0xe0, 0xe0,
122 0x00, 0x00, 0xe0, 0xfe, 0xfe, 0xfe, 0xe0, 0xe0, 0x00, 0xe0, 0xfe, 0xfe, 0xfe, 0xe0, 0x60, 0x00,
123 0xe3, 0xe3, 0xe3, 0x00, 0x00, 0x00, 0xe0, 0xe0, 0xe0, 0xc0, 0xe0, 0xe0, 0xe0, 0x00, 0x00, 0x00,
124 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
125 0x00, 0xf8, 0xf0, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x07, 0x1f, 0x3f, 0x7f, 0x1f,
126 0x07, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xe0, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00,
127 0x00, 0x00, 0x07, 0xff, 0xff, 0xf8, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff,
128 0xff, 0x07, 0x00, 0x01, 0x07, 0x1f, 0x7f, 0xf8, 0xfe, 0x3f, 0x07, 0x01, 0x00, 0x03, 0xff, 0xff,
129 0xfc, 0x00, 0x00, 0x00, 0x1e, 0x7f, 0xff, 0xe1, 0xc0, 0xc0, 0xc0, 0xc0, 0xe1, 0xff, 0xff, 0xff,
130 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00,
131 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
132 0x00, 0x00, 0x00, 0x00, 0x80, 0xfc, 0xff, 0x7f, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80,
133 0xfe, 0xff, 0xff, 0x1f, 0x7f, 0xfe, 0xf8, 0xe0, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
134 0x00, 0x00, 0x00, 0x80, 0xe0, 0xf0, 0xfc, 0x7f, 0x1f, 0xff, 0xff, 0xff, 0xc0, 0x00, 0x00, 0x00,
135 0x00, 0x00, 0x00, 0x00, 0x1f, 0xff, 0xff, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01,
136 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
137 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x01, 0x01, 0x01,
138 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00,
139 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
140 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff,
141 0xff, 0x3f, 0x00, 0x00, 0x00, 0x01, 0x03, 0x0f, 0x3f, 0xff, 0xfc, 0xf0, 0xc0, 0x80, 0x00, 0xc0,
142 0xf0, 0xfc, 0xfe, 0x3f, 0x0f, 0x07, 0x01, 0x00, 0x00, 0x00, 0x3f, 0xff, 0xff, 0xf0, 0x00, 0x00,
143 0x00, 0x00, 0x00, 0x00, 0x78, 0xff, 0xef, 0xcf, 0xce, 0xfc, 0x7c, 0x30, 0x00, 0x00, 0x00, 0x00,
144 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
145 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
146 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
147 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
148 0x00, 0x00, 0x38, 0x3f, 0x3f, 0x3f, 0x38, 0x38, 0x38, 0x38, 0x38, 0x38, 0x38, 0x3c, 0x3f, 0x3f,
149 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x07, 0x1f, 0x3f, 0x3f, 0x1f,
150 0x0f, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x3f, 0x3f, 0x3c, 0x38,
151 0x38, 0x38, 0x38, 0x38, 0x38, 0x38, 0x38, 0x39, 0x39, 0x38, 0x38, 0x38, 0x38, 0x38, 0x38, 0x30,
152 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
153 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
154 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
155 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
156 };
157 oled_write_raw_P(mattir_logo, sizeof(mattir_logo));
158}
159
160static void render_qmk_logo(void) {
161 static const char PROGMEM qmk_logo[] = {
162 0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f,0x90,0x91,0x92,0x93,0x94,
163 0xa0,0xa1,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7,0xa8,0xa9,0xaa,0xab,0xac,0xad,0xae,0xaf,0xb0,0xb1,0xb2,0xb3,0xb4,
164 0xc0,0xc1,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,0xca,0xcb,0xcc,0xcd,0xce,0xcf,0xd0,0xd1,0xd2,0xd3,0xd4,0
165 };
166 oled_write_P(qmk_logo, false);
167}
168
169static void render_status(void) {
170 // QMK Logo and version information
171 render_qmk_logo();
172 oled_write_P(PSTR("Matt's Kyria\n\n"), false);
173 // Host Keyboard Layer Status
174 oled_write_P(PSTR("Layer: "), false);
175 switch (get_highest_layer(layer_state)) {
176 case QWERTY:
177 oled_write_P(PSTR("Default\n"), false);
178 break;
179 case LOWER:
180 oled_write_P(PSTR("Lower\n"), false);
181 break;
182 case RAISE:
183 oled_write_P(PSTR("Raise\n"), false);
184 break;
185 case FUNCS:
186 oled_write_P(PSTR("F-keys\n"), false);
187 break;
188 case RGBLED:
189 oled_write_P(PSTR("Underglow\n"), false);
190 break;
191 default:
192 oled_write_P(PSTR("No idea dog\n"), false);
193 }
194}
195
196void oled_task_user(void) {
197 if (is_keyboard_master()) {
198 render_status(); // Renders the current keyboard layer
199 } else {
200 render_mattir_logo();
201 }
202}
203#endif
204
205// Layer-specific encoder knob functions
206#ifdef ENCODER_ENABLE
207void encoder_update_user(uint8_t index, bool clockwise) {
208 if (index == 0) { // left knob
209 switch (get_highest_layer(layer_state)) {
210 case QWERTY: // Volume
211 if (clockwise) {
212 tap_code(KC_VOLD);
213 } else {
214 tap_code(KC_VOLU);
215 }
216 break;
217 case LOWER: // Desktop switching
218 if (clockwise) {
219 tap_code16(C(KC_RIGHT));
220 } else {
221 tap_code16(C(KC_LEFT));
222 }
223 break;
224 case RAISE: // Mousewheel L/R
225 if (clockwise) {
226 tap_code(KC_WH_L);
227 } else {
228 tap_code(KC_WH_R);
229 }
230 break;
231 case RGBLED: // Underglow color
232 if (clockwise) {
233 rgblight_increase_hue();
234 } else {
235 rgblight_decrease_hue();
236 }
237 break;
238 default: // No action
239 if (clockwise) {
240 tap_code(KC_NO);
241 } else {
242 tap_code(KC_NO);
243 }
244 break;
245 }
246 } else if (index == 1) { // right knob
247 switch (get_highest_layer(layer_state)) {
248 case QWERTY: // Undo / Redo
249 if (clockwise) {
250 tap_code16(LGUI(KC_Z));
251 } else {
252 tap_code16(SGUI(KC_Z));
253 }
254 break;
255 case LOWER: // App switching
256 if (clockwise) {
257 if (!is_cmd_tab_active) {
258 is_cmd_tab_active = true;
259 register_code(KC_LGUI);
260 }
261 cmd_tab_timer = timer_read();
262 tap_code16(KC_TAB);
263 } else {
264 tap_code16(S(KC_TAB));
265 }
266 break;
267 case RAISE: // Mouse wheel U/D
268 if (clockwise) {
269 tap_code(KC_WH_U);
270 } else {
271 tap_code(KC_WH_D);
272 }
273 break;
274 case RGBLED: // Underglow brightness
275 if (clockwise) {
276 rgblight_increase_val();
277 } else {
278 rgblight_decrease_val();
279 }
280 break;
281 default: // No action
282 if (clockwise) {
283 tap_code(KC_NO);
284 } else {
285 tap_code(KC_NO);
286 }
287 break;
288 }
289 }
290}
291#endif
diff --git a/keyboards/kyria/keymaps/mattir/readme.md b/keyboards/kyria/keymaps/mattir/readme.md
new file mode 100644
index 000000000..9a3dcc1e6
--- /dev/null
+++ b/keyboards/kyria/keymaps/mattir/readme.md
@@ -0,0 +1,141 @@
1# Mattir's keymap & configs for [Kyria](https://github.com/splitkb/kyria)
2
3## Keymap
4
5This is my customized keymap and layer setup for my kyria. It's based largely on the defaults, but with several things moved to new layers.
6
7Keys in the diagrams below that are blank are "transparent" and they drop down to the lowest layer that has them defined. The keys at the end of the bottom row marked as `ENC` are where my rotary encoders are installed. The 2U height `Spce/Shft` keys are multi-function. You tap them for a space, or hold them for shift.
8
9### Base layer `QWERTY`
10
11```
12,-------------------------------------------. ,-------------------------------------------.
13| Tab | Q | W | E | R | T | | Y | U | I | O | P | | \ |
14|--------+------+------+------+------+------| |------+------+------+------+------+--------|
15| Esc | A | S | D | F | G | | H | J | K | L | ; : | Enter |
16|--------+------+------+------+------+------+-------------. ,-------------+------+------+------+------+------+--------|
17| Leader | Z | X | C | V | B | ~ ` | | | | - _ | N | M | , < | . > | / ? | ' " |
18`----------------------+------+------+------+------| Spce | | Spce |------+------+------+------+----------------------'
19 | ENC | Ctrl | Supr | Rais | Shft | | Shft | Lowr | Bksp | Alt | ENC |
20 `----------------------------------' `----------------------------------'
21```
22
23### Symbols layer `LOWER`
24
25```
26,-------------------------------------------. ,-------------------------------------------.
27| | ! | @ | # | { | } | | | | | | | |
28|--------+------+------+------+------+------| |------+------+------+------+------+--------|
29| | $ | % | ^ | ( | ) | | = | + | - | * | / | |
30|--------+------+------+------+------+------+-------------. ,-------------+------+------+------+------+------+--------|
31| FUNCS | & | | | [ | ] | | | | | | | | , | . | | |
32`----------------------+------+------+------+------| | | |------+------+------+------+----------------------'
33 | ENC | | | | | | | | | | ENC |
34 `----------------------------------' `----------------------------------'
35```
36
37### Numbers and mouse-keys layer `RAISE`
38
39```
40,-------------------------------------------. ,-------------------------------------------.
41| | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | |
42|--------+------+------+------+------+------| |------+------+------+------+------+--------|
43| | | Prev | Play | Next | | | Left | Down | Up | Right| | |
44|--------+------+------+------+------+------+-------------. ,-------------+------+------+------+------+------+--------|
45| | | LMsB | MMsB | RMsB | | | | | | | MLeft| Mdown| MUp |MRight| | |
46`----------------------+------+------+------+------| | | |------+------+------+------+----------------------'
47 | ENC | | | | | | | | Del | | ENC |
48 `----------------------------------' `----------------------------------'
49```
50
51### F-Keys and number-pad layer `FUNCS`
52
53```
54,-------------------------------------------. ,-------------------------------------------.
55| | F1 | F2 | F3 | F4 | F5 | | np + | np 7 | np 8 | np 9 | np * | |
56|--------+------+------+------+------+------| |------+------+------+------+------+--------|
57| | F6 | F7 | F8 | F9 | F10 | | np - | np 4 | np 5 | np 6 | np / | |
58|--------+------+------+------+------+------+-------------. ,-------------+------+------+------+------+------+--------|
59| FUNCS | F11 | F12 | | | | | | | | | np 0 | np 1 | np 2 | np 3 | np . | = |
60`----------------------+------+------+------+------| | | |------+------+------+------+----------------------'
61 | ENC | | | | | | | | | | ENC |
62 `----------------------------------' `----------------------------------'
63```
64
65### LED Underglow layer `RGBLED`
66
67There's not much on this layer since several of the functions are set up for my rotary encoders.
68
69```
70,-------------------------------------------. ,-------------------------------------------.
71| | | | | | | | | | | | | |
72|--------+------+------+------+------+------| |------+------+------+------+------+--------|
73| | |ValUp |HueUp | SatUp| Mode | | | | | | | |
74|--------+------+------+------+------+------+-------------. ,-------------+------+------+------+------+------+--------|
75| | |ValDn |HueDn | SatDn| Rmode| | | | | | | | | | | |
76`----------------------+------+------+------+------| | | |------+------+------+------+----------------------'
77 | ENC | | | | | | | | | | ENC |
78 `----------------------------------' `----------------------------------'
79```
80
81## Rotary Encoders
82
83I've set up the 2 rotary encoders to serve different functions depending on the active layer. I'll call them `ENC-L` and `ENC-R` for the encoder on the left side, or on the right side. Note that many of these functions are Mac-specific in my case, and if you want to use them for Windows or Linux, you'll need to tweak the key-codes generated.
84
85### Defaults
86
87If a layer is undefined somehow, I have both encoders set to be ignored on rotation.
88
89### Base layer `QWERTY`
90
91`ENC-L`
92* Rotate - Volume up and down, determined by rotation direction.
93* Click - Mute audio.
94
95`ENC-R`
96* Rotate - Undo (command-Z) and Redo (shift-command-Z)
97* Click - Toggle to `RGBLED` layer.
98
99### Symbols layer `LOWER`
100
101`ENC-L`
102* Rotate - Desktop switching on Mac
103* Click - no change (transparent)
104
105`ENC-R`
106* Rotate - App switching on Mac
107* Click - no change (transparent)
108
109### Numbers and mouse-keys layer `RAISE`
110
111`ENC-L`
112* Rotate - Mouse-wheel left and right (equal to side-swiping on Mac trackpads)
113* Click - no change (transparent)
114
115`ENC-R`
116* Rotate - Mouse-wheel up and down
117* Click - no change (transparent)
118
119### F-Keys and number-pad layer `FUNCS`
120
121`ENC-L`
122* Rotate - nothing defined, falls back to defaults
123* Click - no change (transparent)
124
125`ENC-R`
126* Rotate - nothing defined, falls back to defaults
127* Click - no change (transparent)
128
129### LED Underglow layer `RGBLED`
130
131`ENC-L`
132* Rotate - Adjust hue (color) forward and back
133* Click - Turn on/off the underglow LEDs
134
135`ENC-R`
136* Rotate - Adjust the value (brightness) up and down
137* Click - return to the base `QWERTY` layer
138
139## OLEDs
140
141There isn't much special here that isn't already in the default keymap for the Kyria. The main side (where the USB cable is plugged in) will show the QMK logo and the active layer. The secondary side (connected to the main via the TRRS cable) will show my personal logo.
diff --git a/keyboards/kyria/keymaps/mattir/rules.mk b/keyboards/kyria/keymaps/mattir/rules.mk
new file mode 100644
index 000000000..4f5e31be1
--- /dev/null
+++ b/keyboards/kyria/keymaps/mattir/rules.mk
@@ -0,0 +1,4 @@
1OLED_DRIVER_ENABLE = yes # Enables the use of OLED displays
2ENCODER_ENABLE = yes # Enables the use of one or more encoders
3RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow
4LEADER_ENABLE = yes # Enables the use of the leader key