aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFredrik Salomonsson <plattfot@gmail.com>2020-06-01 16:35:44 -0700
committerGitHub <noreply@github.com>2020-06-01 16:35:44 -0700
commit0fee906e0938efc0eb9c6ccc3d2411fe932082c9 (patch)
tree77d51f8c56518a41ff9a6c6fdd3f86fb463187dc
parentc2fd7f1b5b0999769db1f75e07c82f68fa861a06 (diff)
downloadqmk_firmware-0fee906e0938efc0eb9c6ccc3d2411fe932082c9.tar.gz
qmk_firmware-0fee906e0938efc0eb9c6ccc3d2411fe932082c9.zip
[Keymap] plattfot - Kyria layout (#9110)
* [Keymap] plattfot - Kyria layout Keymap for programming, writing in both English and Swedish and easy navigate a tiling window manager. See README.md for more info * Fix letter case on the headline for the readme As suggested by fauxpark * Update keyboards/kyria/keymaps/plattfot/keymap.c Clean up double tap As suggested by fauxpark * Update led check for render_status As suggested by fauxpark * Update to use get_highest_layer for encoder_update_user As suggested by fauxpark * Missing an apostrophe in the header of the README.md Last minute change. * Removed explicit initialization for _DEFAULT As suggested by drashna * Use smaller image for the README.md As suggested by noroadsleft
-rw-r--r--keyboards/kyria/keymaps/plattfot/README.md162
-rw-r--r--keyboards/kyria/keymaps/plattfot/config.h40
-rw-r--r--keyboards/kyria/keymaps/plattfot/keymap.c437
-rw-r--r--keyboards/kyria/keymaps/plattfot/rules.mk5
4 files changed, 644 insertions, 0 deletions
diff --git a/keyboards/kyria/keymaps/plattfot/README.md b/keyboards/kyria/keymaps/plattfot/README.md
new file mode 100644
index 000000000..b5b6ddaa2
--- /dev/null
+++ b/keyboards/kyria/keymaps/plattfot/README.md
@@ -0,0 +1,162 @@
1# plattfot's keymap for [Kyria](https://github.com/splitkb/kyria)
2
3![Keyboard](https://i.imgur.com/Pvsm973l.jpg)
4
5Designed to be ease of use when programming, typing in both English
6and Swedish and navigating around in a tiling window manager, in my
7case [sway](https://swaywm.org/). Uses the two rotary encoders (lower
8left/right thumb row) as two palm buttons.
9
10This keymap avoids [Mod-tap](https://docs.qmk.fm/#/mod_tap) as they do
11not work for me. [Kyria](https://github.com/splitkb/kyria) has enough
12thumb keys to make it work without them.
13
14
15# Base Layer: Default
16```
17 // ,-------------------------------------------. ,-------------------------------------------.
18 // | ` | Q | W | E | R | T | | Y | U | I | O | P | Å |
19 // |--------+------+------+------+------+------| |------+------+------+------+------+--------|
20 // | Tab | A | S | D | F | G | | H | J | K | L | ; : | ' " |
21 // |--------+------+------+------+------+------+-------------. ,-------------+------+------+------+------+------+--------|
22 // | LShift | Z | X | C | V | B | Lead | RAISE| | LOWER|DBLTAP| N | M | , < | . > | / ? | RShift |
23 // `----------------------+------+------+------+------+------| |------+------+------+------+------+----------------------'
24 // | MPlay| GUI | LCtrl| Space| LALT | | Enter|BSpace| NAV | LAlt |Worksp|
25 // | | | | | | | | | | |toggle|
26 // `----------------------------------' `----------------------------------'
27```
28
29Setup for typing in both English and Swedish (hence the Å in the top
30right corner, which is just [ on an US layout).
31
32Modifiers are mostly on the left hand, to make it comfortable when
33require keyboard and mouse. For example working in a DCC (Digital
34Content Creation tool) like [Houdini](https://www.sidefx.com/) and
35[Maya](https://www.autodesk.com/products/maya/overview).
36
37## Notable features on this layer
38
39Left rotary encoder
40- Press: play/pause
41- Rotate: Volume control
42
43Right rotary encoder
44- Press: Call keybinding that toggles between two recent workspaces.
45 For [sway](https://swaywm.org/) that is `workspace
46 back_and_forth`
47- Rotate: Page up/Page down. Used mouse scrolling at first. But
48 scrolling only works in the window where the mouse pointer
49 is. Which kind of defeated the purpose of having the scroll
50 on the keyboard, as I still needed to move my hand to the
51 mouse and then I could just use the scroll on the mouse.
52
53[Leader key](https://docs.qmk.fm/#/feature_leader_key) is mainly used
54for jumping between workspaces. Otherwise I would need to use both
55hands everytime I need to switch. With the leader key I can jump
56between 1-5 with just the left hand. The right rotary encoder also
57helps jumping back and forth between two workspaces by just pressing
58down my right palm.
59
60The double tap key, which I based on a code snippet from a
61[reddit post](https://www.reddit.com/r/olkb/comments/citkbx/double_key_press_modifier_qmkwould_work_like/ev9cue8).
62When pressed, it will repeat the next key twice. Reason for this is
63that I found it a bit awkward to hold down the lower key when I need
64to type a symbol twice. Which happens a lot when programming or
65running commands on the command line. Does not save me any key presses
66but more comfortable to type double keys, for example `--` and `&&`.
67
68# Lower Layer: Symbols
69```
70 //
71 // ,-------------------------------------------. ,-------------------------------------------.
72 // | ~ | ! | @ | # | $ | % | | ^ | & | * | ( | ) | |
73 // |--------+------+------+------+------+------| |------+------+------+------+------+--------|
74 // | | | | _ | \ | - | + | | = | { | } | [ | ] | '' |
75 // |--------+------+------+------+------+------+-------------. ,-------------+------+------+------+------+------+--------|
76 // | | [] | {} | () | <> | | | | | | | | | < | > | ? | |
77 // `----------------------+------+------+------+------+------| |------+------+------+------+------+----------------------'
78 // | Mute | | | | | | | | | | |
79 // | | | | | | | | | | | |
80 // `----------------------------------' `----------------------------------'
81```
82
83Contains most of the symbols, only exceptions are those that are
84already on the default US base layer i.e. quotes, punctuation and
85forward slash.
86
87## Notable features on this layer
88
89Left rotary encoder
90- Press: mute
91- Rotate: Skip next/previous song
92
93The left letter bottom row contains macros to quickly type the
94different types of brackets and move the cursor to be inside. For
95example lower+c will type `()←`, where `←` is pressing the left arrow.
96Same principle for the `''` macro. Really nice to have when
97programming, and it is editor agnostic.
98
99# Raise Layer: Function keys
100```
101 // ,-------------------------------------------. ,-------------------------------------------.
102 // | | F1 | F2 | F3 | F4 | F5 | | F6 | F7 | F8 | F9 | F10 | |
103 // |--------+------+------+------+------+------| |------+------+------+------+------+--------|
104 // | | | | | | F11 | | F12 | | | | | |
105 // |--------+------+------+------+------+------+-------------. ,-------------+------+------+------+------+------+--------|
106 // | | | | | | |ScLock| | | | Ins | | | | | | |
107 // `----------------------+------+------+------+------+------| |------+------+------+------+------+----------------------'
108 // | | | | | | | Esc | Del | | RAlt | |
109 // | | | | | | | | | | | |
110 // `----------------------------------' `----------------------------------'
111```
112
113Access to the functional keys, which I mostly use to run `emacs`
114compilation mode.
115
116Scroll Lock is used to toggle between English and Swedish.
117
118## Notable features on this layer
119
120Right rotary encoder
121- Press: Right Alt, rarely use this, but it is needed for the Swedish
122 layout to type some symbols. But I find I mostly switch back
123 to the English layout if I need to type symbols. Might change
124 this in the future.
125- Rotate: Moving between tabs in the browser, as described in this
126 [blog post](https://docs.splitkb.com/hc/en-us/articles/360010513760-How-can-I-use-a-rotary-encoder-).
127
128# Navigation Layer: Number keys, navigation
129```
130 // ,-------------------------------------------. ,-------------------------------------------.
131 // | | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | |
132 // |--------+------+------+------+------+------| |------+------+------+------+------+--------|
133 // | | | | | | | | | Left | Up | Down | Right| |
134 // |--------+------+------+------+------+------+-------------. ,-------------+------+------+------+------+------+--------|
135 // | | | | | | | | | | | | | | | | | |
136 // `----------------------+------+------+------+------+------| |------+------+------+------+------+----------------------'
137 // | | | | | | | | | | RCtrl| |
138 // | | | | | | | | | | | |
139 // `----------------------------------' `----------------------------------'
140```
141
142Access to the number as well as the arrow keys. Got use to the number
143row after using [ErgoDox](https://www.ergodox.io/) keyboards for a few
144years. Do not feel I need a numpad layer, which seems to be quite
145common with small keyboards like this.
146
147# Adjust Layer: RGB
148```
149 //
150 // ,-------------------------------------------. ,-------------------------------------------.
151 // | | | | | | | | | | | | | |
152 // |--------+------+------+------+------+------| |------+------+------+------+------+--------|
153 // | | TOG | SAI | HUI | VAI | MOD | | | | | | | |
154 // |--------+------+------+------+------+------+-------------. ,-------------+------+------+------+------+------+--------|
155 // | | | SAD | HUD | VAD | RMOD | | | | | | | | | | | |
156 // `----------------------+------+------+------+------+------| |------+------+------+------+------+----------------------'
157 // | | | | | | | | | | | |
158 // | | | | | | | | | | | |
159 // `----------------------------------' `----------------------------------'
160```
161
162Right now it only contains adjustment to the underglow.
diff --git a/keyboards/kyria/keymaps/plattfot/config.h b/keyboards/kyria/keymaps/plattfot/config.h
new file mode 100644
index 000000000..6e21c3ff5
--- /dev/null
+++ b/keyboards/kyria/keymaps/plattfot/config.h
@@ -0,0 +1,40 @@
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#endif
22
23#ifdef RGBLIGHT_ENABLE
24 #define RGBLIGHT_ANIMATIONS
25 #define RGBLIGHT_HUE_STEP 8
26 #define RGBLIGHT_SAT_STEP 8
27 #define RGBLIGHT_VAL_STEP 8
28#endif
29
30#define ENCODER_DIRECTION_FLIP
31// Fixing the skipping with the EC11K encoder
32#define ENCODER_RESOLUTION 2
33
34#define EE_HANDS
35
36// The Leader key allows to flexibly assign macros to key sequences.
37#define LEADER_PER_KEY_TIMING
38#define LEADER_TIMEOUT 350
39
40#define TAPPING_TERM 200
diff --git a/keyboards/kyria/keymaps/plattfot/keymap.c b/keyboards/kyria/keymaps/plattfot/keymap.c
new file mode 100644
index 000000000..d89776989
--- /dev/null
+++ b/keyboards/kyria/keymaps/plattfot/keymap.c
@@ -0,0 +1,437 @@
1/* Copyright 2020 Fredrik Salomonsson <plattfot@gmail.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#include "version.h"
18
19enum custom_keycodes {
20 PLACEHOLDER = SAFE_RANGE, // can always be here
21 // Macros, where | is the cursor
22 M_LRBRC, // [|]
23 M_LRCBR, // {|}
24 M_LRPRN, // (|)
25 M_LRABR, // <|>
26 M_DQUOT, // '|'
27 // New keys
28 DBL_TAP, // Repeat next key
29};
30
31// Double Tap feature based on post from drashna
32// https://www.reddit.com/r/olkb/comments/citkbx/double_key_press_modifier_qmkwould_work_like/ev9cue8/
33static bool double_tap_it = false;
34
35enum layers {
36 _DEFAULT,
37 _LOWER,
38 _RAISE,
39 _NAV,
40 _ADJUST,
41};
42
43// clang-format off
44const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
45/*
46 * Base Layer: Default
47 *
48 * ,-------------------------------------------. ,-------------------------------------------.
49 * | ` | Q | W | E | R | T | | Y | U | I | O | P | Å |
50 * |--------+------+------+------+------+------| |------+------+------+------+------+--------|
51 * | Tab | A | S | D | F | G | | H | J | K | L | ; : | ' " |
52 * |--------+------+------+------+------+------+-------------. ,-------------+------+------+------+------+------+--------|
53 * | LShift | Z | X | C | V | B | Lead | RAISE| | LOWER|DBLTAP| N | M | , < | . > | / ? | RShift |
54 * `----------------------+------+------+------+------+------| |------+------+------+------+------+----------------------'
55 * | MPlay| GUI | LCtrl| Space| LALT | | Enter|BSpace| NAV | LAlt |Worksp|
56 * | | | | | | | | | | |toggle|
57 * `----------------------------------' `----------------------------------'
58 */
59 [_DEFAULT] = LAYOUT(
60 KC_GRV, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC,
61 KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT,
62 KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_LEAD, OSL(_RAISE), OSL(_LOWER), DBL_TAP, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT,
63 KC_MPLY, KC_LGUI, KC_LCTL, KC_SPACE, KC_LALT, KC_ENT, KC_BSPC, MO(_NAV), LCTL(KC_LALT), LGUI(KC_B)
64 ),
65
66/*
67 * Lower Layer: Symbols
68 *
69 * ,-------------------------------------------. ,-------------------------------------------.
70 * | ~ | ! | @ | # | $ | % | | ^ | & | * | ( | ) | |
71 * |--------+------+------+------+------+------| |------+------+------+------+------+--------|
72 * | | | | _ | \ | - | + | | = | { | } | [ | ] | '' |
73 * |--------+------+------+------+------+------+-------------. ,-------------+------+------+------+------+------+--------|
74 * | | [] | {} | () | <> | | | | | | | | | < | > | ? | |
75 * `----------------------+------+------+------+------+------| |------+------+------+------+------+----------------------'
76 * | Mute | | | | | | | | | | |
77 * | | | | | | | | | | | |
78 * `----------------------------------' `----------------------------------'
79 */
80 [_LOWER] = LAYOUT(
81 KC_TILDE,KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______,
82 _______, KC_PIPE, KC_UNDS, KC_BSLS, KC_MINS, KC_PLUS, KC_EQUAL,KC_LCBR, KC_RCBR, KC_LBRC, KC_RBRC, M_DQUOT,
83 _______, M_LRBRC, M_LRCBR, M_LRPRN, M_LRABR, _______, _______, _______, _______, _______, _______, _______, KC_LT, KC_GT, KC_QUES, _______,
84 KC_MUTE, _______, _______, _______, _______, _______, _______, _______, _______, _______
85 ),
86/*
87 * Raise Layer: Function keys
88 *
89 * ,-------------------------------------------. ,-------------------------------------------.
90 * | | F1 | F2 | F3 | F4 | F5 | | F6 | F7 | F8 | F9 | F10 | |
91 * |--------+------+------+------+------+------| |------+------+------+------+------+--------|
92 * | | | | | | F11 | | F12 | | | | | |
93 * |--------+------+------+------+------+------+-------------. ,-------------+------+------+------+------+------+--------|
94 * | | | | | | |ScLock| | | | Ins | | | | | | |
95 * `----------------------+------+------+------+------+------| |------+------+------+------+------+----------------------'
96 * | | | | | | | Esc | Del | | RAlt | |
97 * | | | | | | | | | | | |
98 * `----------------------------------' `----------------------------------'
99 */
100 [_RAISE] = LAYOUT(
101 _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, _______,
102 _______, _______, _______, _______, _______, KC_F11, KC_F12, _______, _______, _______, _______, _______,
103 _______, _______, _______, _______, _______, _______, KC_SLCK, _______, _______, KC_INS, _______, _______, _______, _______, _______, _______,
104 _______, _______, _______, _______, _______, KC_ESC, KC_DEL, _______, KC_RALT, _______
105
106 ),
107/*
108 * Navigation Layer: Number keys, navigation
109 *
110 * ,-------------------------------------------. ,-------------------------------------------.
111 * | | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | |
112 * |--------+------+------+------+------+------| |------+------+------+------+------+--------|
113 * | | | | | | | | | Left | Up | Down | Right| |
114 * |--------+------+------+------+------+------+-------------. ,-------------+------+------+------+------+------+--------|
115 * | | | | | | | | | | | | | | | | | |
116 * `----------------------+------+------+------+------+------| |------+------+------+------+------+----------------------'
117 * | | | | | | | | | | RCtrl| |
118 * | | | | | | | | | | | |
119 * `----------------------------------' `----------------------------------'
120 */
121 [_NAV] = LAYOUT(
122 _______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______,
123 _______, _______, _______, _______, _______, _______, _______, KC_LEFT, KC_UP, KC_DOWN, KC_RGHT, _______,
124 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
125 _______, _______, _______, _______, _______, _______, _______, _______, KC_RCTL, _______
126 ),
127/*
128 * Adjust Layer: RGB
129 *
130 * ,-------------------------------------------. ,-------------------------------------------.
131 * | | | | | | | | | | | | | |
132 * |--------+------+------+------+------+------| |------+------+------+------+------+--------|
133 * | | TOG | SAI | HUI | VAI | MOD | | | | | | | |
134 * |--------+------+------+------+------+------+-------------. ,-------------+------+------+------+------+------+--------|
135 * | | | SAD | HUD | VAD | RMOD | | | | | | | | | | | |
136 * `----------------------+------+------+------+------+------| |------+------+------+------+------+----------------------'
137 * | | | | | | | | | | | |
138 * | | | | | | | | | | | |
139 * `----------------------------------' `----------------------------------'
140 */
141 [_ADJUST] = LAYOUT(
142 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
143 _______, RGB_TOG, RGB_SAI, RGB_HUI, RGB_VAI, RGB_MOD, _______, _______, _______, _______, _______, _______,
144 _______, _______, RGB_SAD, RGB_HUD, RGB_VAD, RGB_RMOD,_______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
145 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
146 ),
147// /*
148// * Layer template
149// *
150// * ,-------------------------------------------. ,-------------------------------------------.
151// * | | | | | | | | | | | | | |
152// * |--------+------+------+------+------+------| |------+------+------+------+------+--------|
153// * | | | | | | | | | | | | | |
154// * |--------+------+------+------+------+------+-------------. ,-------------+------+------+------+------+------+--------|
155// * | | | | | | | | | | | | | | | | | |
156// * `----------------------+------+------+------+------+------| |------+------+------+------+------+----------------------'
157// * | | | | | | | | | | | |
158// * | | | | | | | | | | | |
159// * `----------------------------------' `----------------------------------'
160// */
161// [_LAYERINDEX] = LAYOUT(
162// _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
163// _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
164// _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
165// _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
166// ),
167};
168// clang-format on
169
170/* void keyboard_post_init_user(void) { */
171/* rgblight_setrgb(51, 135, 204); */
172/* } */
173bool process_record_user(uint16_t keycode, keyrecord_t *record) {
174 if (record->event.pressed) {
175 switch (keycode) {
176 case M_LRPRN:
177 // Double tap gets messed up with macros, turning it off
178 double_tap_it = false;
179 SEND_STRING("()" SS_TAP(X_LEFT));
180 clear_oneshot_layer_state(ONESHOT_OTHER_KEY_PRESSED);
181 return false;
182 case M_LRCBR:
183 double_tap_it = false;
184 SEND_STRING("{}" SS_TAP(X_LEFT));
185 clear_oneshot_layer_state(ONESHOT_OTHER_KEY_PRESSED);
186 return false;
187 case M_LRBRC:
188 double_tap_it = false;
189 SEND_STRING("[]" SS_TAP(X_LEFT));
190 clear_oneshot_layer_state(ONESHOT_OTHER_KEY_PRESSED);
191 return false;
192 case M_LRABR:
193 double_tap_it = false;
194 SEND_STRING("<>" SS_TAP(X_LEFT));
195 clear_oneshot_layer_state(ONESHOT_OTHER_KEY_PRESSED);
196 return false;
197 case M_DQUOT:
198 double_tap_it = false;
199 SEND_STRING("''" SS_TAP(X_LEFT));
200 clear_oneshot_layer_state(ONESHOT_OTHER_KEY_PRESSED);
201 return false;
202 case DBL_TAP:
203 double_tap_it = !double_tap_it;
204 return false;
205 case KC_LEAD:
206 double_tap_it = false;
207 return true;
208 }
209 } else if (double_tap_it && keycode != DBL_TAP) {
210 double_tap_it = false;
211 tap_code16(keycode);
212 clear_oneshot_layer_state(ONESHOT_OTHER_KEY_PRESSED);
213 }
214
215 return true;
216}
217
218layer_state_t layer_state_set_user(layer_state_t state) { return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); }
219
220#ifdef OLED_DRIVER_ENABLE
221oled_rotation_t oled_init_user(oled_rotation_t rotation) { return OLED_ROTATION_180; }
222
223// clang-format off
224static void render_kyria_logo(void) {
225 static const char PROGMEM kyria_logo[] = {
226 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128,128,192,224,240,112,120, 56, 60, 28, 30, 14, 14, 14, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 14, 14, 14, 30, 28, 60, 56,120,112,240,224,192,128,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
227 0, 0, 0, 0, 0, 0, 0,192,224,240,124, 62, 31, 15, 7, 3, 1,128,192,224,240,120, 56, 60, 28, 30, 14, 14, 7, 7,135,231,127, 31,255,255, 31,127,231,135, 7, 7, 14, 14, 30, 28, 60, 56,120,240,224,192,128, 1, 3, 7, 15, 31, 62,124,240,224,192, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
228 0, 0, 0, 0,240,252,255, 31, 7, 1, 0, 0,192,240,252,254,255,247,243,177,176, 48, 48, 48, 48, 48, 48, 48,120,254,135, 1, 0, 0,255,255, 0, 0, 1,135,254,120, 48, 48, 48, 48, 48, 48, 48,176,177,243,247,255,254,252,240,192, 0, 0, 1, 7, 31,255,252,240, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
229 0, 0, 0,255,255,255, 0, 0, 0, 0, 0,254,255,255, 1, 1, 7, 30,120,225,129,131,131,134,134,140,140,152,152,177,183,254,248,224,255,255,224,248,254,183,177,152,152,140,140,134,134,131,131,129,225,120, 30, 7, 1, 1,255,255,254, 0, 0, 0, 0, 0,255,255,255, 0, 0, 0, 0,255,255, 0, 0,192,192, 48, 48, 0, 0,240,240, 0, 0, 0, 0, 0, 0,240,240, 0, 0,240,240,192,192, 48, 48, 48, 48,192,192, 0, 0, 48, 48,243,243, 0, 0, 0, 0, 0, 0, 48, 48, 48, 48, 48, 48,192,192, 0, 0, 0, 0, 0,
230 0, 0, 0,255,255,255, 0, 0, 0, 0, 0,127,255,255,128,128,224,120, 30,135,129,193,193, 97, 97, 49, 49, 25, 25,141,237,127, 31, 7,255,255, 7, 31,127,237,141, 25, 25, 49, 49, 97, 97,193,193,129,135, 30,120,224,128,128,255,255,127, 0, 0, 0, 0, 0,255,255,255, 0, 0, 0, 0, 63, 63, 3, 3, 12, 12, 48, 48, 0, 0, 0, 0, 51, 51, 51, 51, 51, 51, 15, 15, 0, 0, 63, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, 48, 63, 63, 48, 48, 0, 0, 12, 12, 51, 51, 51, 51, 51, 51, 63, 63, 0, 0, 0, 0, 0,
231 0, 0, 0, 0, 15, 63,255,248,224,128, 0, 0, 3, 15, 63,127,255,239,207,141, 13, 12, 12, 12, 12, 12, 12, 12, 30,127,225,128, 0, 0,255,255, 0, 0,128,225,127, 30, 12, 12, 12, 12, 12, 12, 12, 13,141,207,239,255,127, 63, 15, 3, 0, 0,128,224,248,255, 63, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
232 0, 0, 0, 0, 0, 0, 0, 3, 7, 15, 62,124,248,240,224,192,128, 1, 3, 7, 15, 30, 28, 60, 56,120,112,112,224,224,225,231,254,248,255,255,248,254,231,225,224,224,112,112,120, 56, 60, 28, 30, 15, 7, 3, 1,128,192,224,240,248,124, 62, 15, 7, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
233 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 3, 7, 15, 14, 30, 28, 60, 56,120,112,112,112,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,112,112,112,120, 56, 60, 28, 30, 14, 15, 7, 3, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
234 };
235 oled_write_raw_P(kyria_logo, sizeof(kyria_logo));
236}
237
238static void render_qmk_logo(void) {
239 static const char PROGMEM qmk_logo[] = {
240 0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f,0x90,0x91,0x92,0x93,0x94,
241 0xa0,0xa1,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7,0xa8,0xa9,0xaa,0xab,0xac,0xad,0xae,0xaf,0xb0,0xb1,0xb2,0xb3,0xb4,
242 0xc0,0xc1,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,0xca,0xcb,0xcc,0xcd,0xce,0xcf,0xd0,0xd1,0xd2,0xd3,0xd4,0};
243
244 oled_write_P(qmk_logo, false);
245}
246// clang-format on
247
248static void render_status(void) {
249 // QMK Logo and version information
250 render_qmk_logo();
251 oled_write_P(PSTR("Kyria rev1.0\n"), false);
252 oled_write_P(PSTR("v" QMK_VERSION "\n"), false);
253
254 // Host Keyboard Layer Status
255 oled_write_P(PSTR("Layer: "), false);
256 switch (get_highest_layer(layer_state)) {
257 case _DEFAULT:
258 oled_write_P(PSTR("plattfot\n"), false);
259 break;
260 case _LOWER:
261 oled_write_P(PSTR("symbols\n"), false);
262 break;
263 case _RAISE:
264 oled_write_P(PSTR("function keys\n"), false);
265 break;
266 case _NAV:
267 oled_write_P(PSTR("numbers/navi\n"), false);
268 break;
269 case _ADJUST:
270 oled_write_P(PSTR("adjust\n"), false);
271 break;
272 default:
273 oled_write_P(PSTR("undefined\n"), false);
274 }
275
276 // Host Keyboard LED Status and Double tap
277 led_t led_state = host_keyboard_led_state();
278 if (led_state.num_lock) {
279 oled_write_P(PSTR("NUMLCK "), false);
280 } else if (double_tap_it) {
281 oled_write_P(PSTR("Double "), false);
282 } else {
283 oled_write_P(PSTR(" "), false);
284 }
285
286 if (led_state.caps_lock) {
287 oled_write_P(PSTR("CAPLCK "), false);
288 } else if (double_tap_it) {
289 oled_write_P(PSTR("Tap "), false);
290 } else {
291 oled_write_P(PSTR(" "), false);
292 }
293
294 oled_write_P(led_state.scroll_lock ? PSTR("SCRLCK ") : PSTR(" "), false);
295}
296
297void oled_task_user(void) {
298 if (is_keyboard_master()) {
299 render_status(); // Renders the current keyboard state (layer, lock, caps, scroll, etc)
300 } else {
301 render_kyria_logo();
302 }
303}
304#endif
305
306#ifdef ENCODER_ENABLE
307void encoder_update_user(uint8_t index, bool clockwise) {
308 if (index == 0) {
309 switch (get_highest_layer(layer_state)) {
310 case _LOWER:
311 // Skip/Prev song
312 if (clockwise) {
313 tap_code(KC_MNXT);
314 clear_oneshot_layer_state(ONESHOT_OTHER_KEY_PRESSED);
315 } else {
316 tap_code(KC_MPRV);
317 clear_oneshot_layer_state(ONESHOT_OTHER_KEY_PRESSED);
318 }
319 break;
320 default:
321 // Volume control
322 if (clockwise) {
323 tap_code(KC_VOLU);
324 clear_oneshot_layer_state(ONESHOT_OTHER_KEY_PRESSED);
325 } else {
326 tap_code(KC_VOLD);
327 clear_oneshot_layer_state(ONESHOT_OTHER_KEY_PRESSED);
328 }
329 break;
330 }
331 } else if (index == 1) {
332 switch (get_highest_layer(layer_state)) {
333 case _RAISE:
334 // Credit to Thomas Baart for this
335 // See https://docs.splitkb.com/hc/en-us/articles/360010513760-How-can-I-use-a-rotary-encoder-
336 if (clockwise) {
337 tap_code16(C(KC_TAB));
338 clear_oneshot_layer_state(ONESHOT_OTHER_KEY_PRESSED);
339 } else {
340 tap_code16(S(C(KC_TAB)));
341 clear_oneshot_layer_state(ONESHOT_OTHER_KEY_PRESSED);
342 }
343 break;
344 default:
345 // Scrolling
346 if (clockwise) {
347 tap_code(KC_PGDN);
348 clear_oneshot_layer_state(ONESHOT_OTHER_KEY_PRESSED);
349 } else {
350 tap_code(KC_PGUP);
351 clear_oneshot_layer_state(ONESHOT_OTHER_KEY_PRESSED);
352 }
353 break;
354 }
355 }
356}
357#endif
358
359LEADER_EXTERNS();
360
361void matrix_scan_user(void) {
362 LEADER_DICTIONARY() {
363 leading = false;
364 leader_end();
365 // Sway navigation
366 SEQ_ONE_KEY(KC_Q) { // Jump to workspace 1
367 SEND_STRING(SS_LGUI("1"));
368 }
369 SEQ_ONE_KEY(KC_W) { // Jump to workspace 2
370 SEND_STRING(SS_LGUI("2"));
371 }
372 SEQ_ONE_KEY(KC_E) { // Jump to workspace 3
373 SEND_STRING(SS_LGUI("3"));
374 }
375 SEQ_ONE_KEY(KC_R) { // Jump to workspace 4
376 SEND_STRING(SS_LGUI("4"));
377 }
378 SEQ_ONE_KEY(KC_T) { // Jump to workspace 5
379 SEND_STRING(SS_LGUI("5"));
380 }
381
382 SEQ_ONE_KEY(KC_Y) { // Jump to workspace 6
383 SEND_STRING(SS_LGUI("6"));
384 }
385 SEQ_ONE_KEY(KC_U) { // Jump to workspace 7
386 SEND_STRING(SS_LGUI("7"));
387 }
388 SEQ_ONE_KEY(KC_I) { // Jump to workspace 8
389 SEND_STRING(SS_LGUI("8"));
390 }
391 SEQ_ONE_KEY(KC_O) { // Jump to workspace 9
392 SEND_STRING(SS_LGUI("9"));
393 }
394 SEQ_ONE_KEY(KC_P) { // Jump to workspace 0
395 SEND_STRING(SS_LGUI("0"));
396 }
397 SEQ_ONE_KEY(KC_G) { // View scratch pad
398 SEND_STRING(SS_LGUI("-"));
399 }
400
401 // Sway move window
402 SEQ_TWO_KEYS(KC_M, KC_Q) { // Move to workspace 1
403 SEND_STRING(SS_LSFT(SS_LGUI("1")));
404 }
405 SEQ_TWO_KEYS(KC_M, KC_W) { // Move to workspace 2
406 SEND_STRING(SS_LSFT(SS_LGUI("2")));
407 }
408 SEQ_TWO_KEYS(KC_M, KC_E) { // Move to workspace 3
409 SEND_STRING(SS_LSFT(SS_LGUI("3")));
410 }
411 SEQ_TWO_KEYS(KC_M, KC_R) { // Move to workspace 4
412 SEND_STRING(SS_LSFT(SS_LGUI("4")));
413 }
414 SEQ_TWO_KEYS(KC_M, KC_T) { // Move to workspace 5
415 SEND_STRING(SS_LSFT(SS_LGUI("5")));
416 }
417
418 SEQ_TWO_KEYS(KC_M, KC_Y) { // Move to workspace 6
419 SEND_STRING(SS_LSFT(SS_LGUI("6")));
420 }
421 SEQ_TWO_KEYS(KC_M, KC_U) { // Move to workspace 7
422 SEND_STRING(SS_LSFT(SS_LGUI("7")));
423 }
424 SEQ_TWO_KEYS(KC_M, KC_I) { // Move to workspace 8
425 SEND_STRING(SS_LSFT(SS_LGUI("8")));
426 }
427 SEQ_TWO_KEYS(KC_M, KC_O) { // Move to workspace 9
428 SEND_STRING(SS_LSFT(SS_LGUI("9")));
429 }
430 SEQ_TWO_KEYS(KC_M, KC_P) { // Move to workspace 0
431 SEND_STRING(SS_LSFT(SS_LGUI("0")));
432 }
433 SEQ_TWO_KEYS(KC_M, KC_G) { // Move to scratch pad
434 SEND_STRING(SS_LSFT(SS_LGUI("-")));
435 }
436 }
437}
diff --git a/keyboards/kyria/keymaps/plattfot/rules.mk b/keyboards/kyria/keymaps/plattfot/rules.mk
new file mode 100644
index 000000000..412546d09
--- /dev/null
+++ b/keyboards/kyria/keymaps/plattfot/rules.mk
@@ -0,0 +1,5 @@
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 # Enable the Leader Key feature
5MOUSEKEY_ENABLE = no # Disable mouse, need to save space.