aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQMK Bot <hello@qmk.fm>2021-07-11 05:37:58 +0000
committerQMK Bot <hello@qmk.fm>2021-07-11 05:37:58 +0000
commit36890181f7c68af073fe3d6e9dac68a9e089284a (patch)
treebf60e498d07897eda3131ce2d17a83922df69bf2
parent0bfb14409ac6cf31f482bab952d9c3c0ccef2d1b (diff)
parent0a8accae063460f20ca83c559afdfce0fa2d00f3 (diff)
downloadqmk_firmware-36890181f7c68af073fe3d6e9dac68a9e089284a.tar.gz
qmk_firmware-36890181f7c68af073fe3d6e9dac68a9e089284a.zip
Merge remote-tracking branch 'origin/master' into develop
-rw-r--r--keyboards/kyria/keymaps/plattfot/README.md170
-rw-r--r--keyboards/kyria/keymaps/plattfot/config.h6
-rw-r--r--keyboards/kyria/keymaps/plattfot/keymap.c239
3 files changed, 233 insertions, 182 deletions
diff --git a/keyboards/kyria/keymaps/plattfot/README.md b/keyboards/kyria/keymaps/plattfot/README.md
index 860a3b782..70bb01353 100644
--- a/keyboards/kyria/keymaps/plattfot/README.md
+++ b/keyboards/kyria/keymaps/plattfot/README.md
@@ -1,6 +1,6 @@
1# plattfot's keymap for [Kyria](https://github.com/splitkb/kyria) 1# plattfot's keymap for [Kyria](https://github.com/splitkb/kyria)
2 2
3![Keyboard](https://i.imgur.com/Pvsm973l.jpg) 3![Keyboard](https://i.imgur.com/mcefoHnh.jpg)
4 4
5Designed to be ease of use when programming, typing in both English 5Designed to be ease of use when programming, typing in both English
6and Swedish and navigating around in a tiling window manager, in my 6and Swedish and navigating around in a tiling window manager, in my
@@ -11,28 +11,44 @@ This 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 11not work for me. [Kyria](https://github.com/splitkb/kyria) has enough
12thumb keys to make it work without them. 12thumb keys to make it work without them.
13 13
14The symbols are split into two layers, one for each hand. Then the
15layers are activated by the opposite thumb. Found that having all
16symbols on one layer then have one thumb activate them made it awkward
17to press keys with the index finger on the same hand.
18
19Custom feature I call the close tap (Clotap) key, I based on a code
20snippet from a
21[reddit post](https://www.reddit.com/r/olkb/comments/citkbx/double_key_press_modifier_qmkwould_work_like/ev9cue8).
22When pressed, it will insert the closing equivivalent key and press
23`←` (left arrow). For example tapping Clotap then press `(` will
24result in the keypresses `()←`, if pressing `"` will result in `""←`,
25if pressing `)` will result in `)←(`. Really nice to have when
26programming, it is editor agnostic and saves me two keypresses (need
27to press NAV+j for `←`). It also removes the need for having specific
28macros for these as I had before.
29
14 30
15# Base Layer: Default 31# Base Layer: Default
16``` 32```
17 // ,-------------------------------------------. ,-------------------------------------------. 33// ,-------------------------------------------. ,-------------------------------------------.
18 // | ` | Q | W | E | R | T | | Y | U | I | O | P | Å | 34// | Esc | Q | W | E | R | T | | Y | U | I | O | P | Del |
19 // |--------+------+------+------+------+------| |------+------+------+------+------+--------| 35// |--------+------+------+------+------+------| |------+------+------+------+------+--------|
20 // | Tab | A | S | D | F | G | | H | J | K | L | ; : | ' " | 36// | Tab | A | S | D | F | G | | H | J | K | L | ; | ' |
21 // |--------+------+------+------+------+------+-------------. ,-------------+------+------+------+------+------+--------| 37// |--------+------+------+------+------+------+-------------. ,-------------+------+------+------+------+------+--------|
22 // | LShift | Z | X | C | V | B | Lead | RAISE| | LOWER|DBLTAP| N | M | , < | . > | / ? | RShift | 38// | LShift | Z | X | C | V | B | Lead | RAISE| | LOWER|BSpace| N | M | , | . | / | RShift |
23 // `----------------------+------+------+------+------+------| |------+------+------+------+------+----------------------' 39// `----------------------+------+------+------+------+------| |------+------+------+------+------+----------------------'
24 // | MPlay| GUI | LCtrl| Space| LALT | | Enter|BSpace| NAV | LCTL+|Worksp| 40// | MPlay| GUI | LCtrl| Space| LALT | | RCtrl| Enter| NAV | RALT |Scroll|
25 // | | | | | | | | | | LALT |toggle| 41// | | | | | | | | | | | Lock |
26 // `----------------------------------' `----------------------------------' 42// `----------------------------------' `----------------------------------'
27``` 43```
28 44
29Setup for typing in both English and Swedish (hence the Å in the top 45Setup for using the
30right corner, which is just [ on an US layout). 46[EurKey](https://eurkey.steffen.bruentjen.eu/layout.html) layout. As
47it's annoying to have to toggle us and swedish layout which shifts
48symbols around.
31 49
32Modifiers are mostly on the left hand, to make it comfortable when 50AltGr is used to access the extra keys in the
33require keyboard and mouse. For example working in a DCC (Digital 51[EurKey](https://eurkey.steffen.bruentjen.eu/layout.html) layout.
34Content Creation tool) like [Houdini](https://www.sidefx.com/) and
35[Maya](https://www.autodesk.com/products/maya/overview).
36 52
37## Notable features on this layer 53## Notable features on this layer
38 54
@@ -41,9 +57,7 @@ Left rotary encoder
41- Rotate: Volume control 57- Rotate: Volume control
42 58
43Right rotary encoder 59Right rotary encoder
44- Press: Call keybinding that toggles between two recent workspaces. 60- Press: Scroll lock
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 61- Rotate: Page up/Page down. Used mouse scrolling at first. But
48 scrolling only works in the window where the mouse pointer 62 scrolling only works in the window where the mouse pointer
49 is. Which kind of defeated the purpose of having the scroll 63 is. Which kind of defeated the purpose of having the scroll
@@ -53,103 +67,92 @@ Right rotary encoder
53[Leader key](https://docs.qmk.fm/#/feature_leader_key) is mainly used 67[Leader key](https://docs.qmk.fm/#/feature_leader_key) is mainly used
54for jumping between workspaces. Otherwise I would need to use both 68for jumping between workspaces. Otherwise I would need to use both
55hands everytime I need to switch. With the leader key I can jump 69hands 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 70between 1-5 with just the left hand.
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 71
68# Lower Layer: Symbols 72# Lower Layer: Left symbols/Right function keys
69``` 73```
70 // 74// ,-------------------------------------------. ,-------------------------------------------.
71 // ,-------------------------------------------. ,-------------------------------------------. 75// | | ! | @ | # | $ | % | | F6 | F7 | F8 | F9 | F10 | |
72 // | ~ | ! | @ | # | $ | % | | ^ | & | * | ( | ) | | 76// |--------+------+------+------+------+------| |------+------+------+------+------+--------|
73 // |--------+------+------+------+------+------| |------+------+------+------+------+--------| 77// | | | | _ | \ | - | + | | F12 | | | | | |
74 // | | | | _ | \ | - | + | | = | { | } | [ | ] | '' | 78// |--------+------+------+------+------+------+-------------. ,-------------+------+------+------+------+------+--------|
75 // |--------+------+------+------+------+------+-------------. ,-------------+------+------+------+------+------+--------| 79// | | ° | : | ( | ) | × | |ADJUST| | | |CLOTAP| | | | | |
76 // | | [] | {} | () | <> | | | | | | | | | < | > | ? | | 80// `----------------------+------+------+------+------+------| |------+------+------+------+------+----------------------'
77 // `----------------------+------+------+------+------+------| |------+------+------+------+------+----------------------' 81// | | | | | | | | | | | |
78 // | Mute | | | | | | | | | | | 82// | | | | | | | | | | | |
79 // | | | | | | | | | | | | 83// `----------------------------------' `----------------------------------'
80 // `----------------------------------' `----------------------------------'
81``` 84```
82 85
83Contains most of the symbols, only exceptions are those that are 86Symbols for the left hand, function keys for the right hand.
84already on the default US base layer i.e. quotes, punctuation and 87
85forward slash. 88I had the function keys at the bottom on the navigation layer. But it
89was annoying when typing version strings. Hitting f1-5+f11 involved
90both hands. And it turned out that my keybinding for closing a window
91(Super+Shift+c) and rebooting my machine (Super+Shift+f3) ended up on
92the same physical keys.
93
94Splitting them up like this allows me to hit all the function keys
95with just one hand and I wont accidentally reboot my machine when
96trying to close a window.
86 97
87## Notable features on this layer 98## Notable features on this layer
88 99
89Left rotary encoder 100Left rotary encoder
90- Press: mute
91- Rotate: Skip next/previous song 101- Rotate: Skip next/previous song
92 102
93The left letter bottom row contains macros to quickly type the 103Clotap on the right hand.
94different types of brackets and move the cursor to be inside. For 104
95example lower+c will type `()←`, where `←` is pressing the left arrow. 105Has two Eurkey specific symbols `°` and `×` on the left hand.
96Same principle for the `''` macro. Really nice to have when
97programming, and it is editor agnostic.
98 106
99# Raise Layer: Function keys 107# Raise Layer: Left function/Right symbols + state keys
100``` 108```
101 // ,-------------------------------------------. ,-------------------------------------------. 109// ,-------------------------------------------. ,-------------------------------------------.
102 // | | F1 | F2 | F3 | F4 | F5 | | F6 | F7 | F8 | F9 | F10 | | 110// | | F1 | F2 | F3 | F4 | F5 | | ^ | & | * | ~ | ? | |
103 // |--------+------+------+------+------+------| |------+------+------+------+------+--------| 111// |--------+------+------+------+------+------| |------+------+------+------+------+--------|
104 // | | | | | | F11 | | F12 | | | | | | 112// | | | | | | F11 | | = | { | } | [ | ] | ` |
105 // |--------+------+------+------+------+------+-------------. ,-------------+------+------+------+------+------+--------| 113// |--------+------+------+------+------+------+-------------. ,-------------+------+------+------+------+------+--------|
106 // | | | | | | |ScLock| | | | Ins | | | | | |CapsLock| 114// | | | | | |CLOTAP| | | |ADJUST| | | " | < | > | / |CapsLock|
107 // `----------------------+------+------+------+------+------| |------+------+------+------+------+----------------------' 115// `----------------------+------+------+------+------+------| |------+------+------+------+------+----------------------'
108 // | | | | | | | | | | RAlt | | 116// | Mute | | | | | | | | | |Insert|
109 // | | | | | | | | | | | | 117// | | | | | | | | | | | |
110 // `----------------------------------' `----------------------------------' 118// `----------------------------------' `----------------------------------'
111``` 119```
112 120
113Access to the functional keys, which I mostly use to run `emacs` 121Function keys for the left hand, symbols for the right hand.
114compilation mode.
115 122
116This layer also includes key that changes the state, like insert and 123This layer also includes caps lock and insert.
117caps lock.
118
119Scroll Lock is used to toggle between English and Swedish.
120 124
121## Notable features on this layer 125## Notable features on this layer
122 126
127Left rotary encoder
128- Press: mute
129
123Right rotary encoder 130Right rotary encoder
124- Press: Right Alt, rarely use this, but it is needed for the Swedish 131- Press: Toggle insert mode
125 layout to type some symbols. But I find I mostly switch back 132- Rotate: Scrolling between workspaces in `sway`.
126 to the English layout if I need to type symbols. Might change 133
127 this in the future. 134Clotap on the left hand.
128- Rotate: Moving between tabs in the browser, as described in this
129 [blog post](https://docs.splitkb.com/hc/en-us/articles/360010513760-How-can-I-use-a-rotary-encoder-).
130 135
131# Navigation Layer: Number keys, navigation 136# Navigation Layer: Number keys, navigation
132``` 137```
138 //
133 // ,-------------------------------------------. ,-------------------------------------------. 139 // ,-------------------------------------------. ,-------------------------------------------.
134 // | | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | | 140 // | | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | |
135 // |--------+------+------+------+------+------| |------+------+------+------+------+--------| 141 // |--------+------+------+------+------+------| |------+------+------+------+------+--------|
136 // | | | ESC | DEL | | | | | Left | Up | Down | Right| | 142 // | | | | | | | | | Left | Up | Down | Right| |
137 // |--------+------+------+------+------+------+-------------. ,-------------+------+------+------+------+------+--------| 143 // |--------+------+------+------+------+------+-------------. ,-------------+------+------+------+------+------+--------|
138 // | | | | | | | | | | | | | | | | | | 144 // | | | | | | | | | | | | | | | | | |
139 // `----------------------+------+------+------+------+------| |------+------+------+------+------+----------------------' 145 // `----------------------+------+------+------+------+------| |------+------+------+------+------+----------------------'
140 // | | | | | | | | | | RCtrl| | 146 // | | | | | | | | | | | |
141 // | | | | | | | | | | | | 147 // | | | | | | | | | | | |
142 // `----------------------------------' `----------------------------------' 148 // `----------------------------------' `----------------------------------'
143``` 149```
144 150
145Access to the number as well as the arrow keys. Got use to the number 151Access to the number and the arrow keys. Got use to the number row
146row after using [ErgoDox](https://www.ergodox.io/) keyboards for a few 152after using [ErgoDox](https://www.ergodox.io/) keyboards for a few
147years. Do not feel I need a numpad layer, which seems to be quite 153years. Do not feel I need a numpad layer, which seems to be quite
148common with small keyboards like this. 154common with small keyboards like this.
149 155
150Esc and Delete is also on this layer as they are easy to reach and they
151only need to be chord with the modifiers.
152
153# Adjust Layer: RGB 156# Adjust Layer: RGB
154``` 157```
155 // 158 //
@@ -165,4 +168,5 @@ only need to be chord with the modifiers.
165 // `----------------------------------' `----------------------------------' 168 // `----------------------------------' `----------------------------------'
166``` 169```
167 170
168Right now it only contains adjustment to the underglow. 171Right now it only contains adjustment to the underglow. Activated by
172holding down `RAISE` and `LOWER` at the same time.
diff --git a/keyboards/kyria/keymaps/plattfot/config.h b/keyboards/kyria/keymaps/plattfot/config.h
index 6e21c3ff5..5ec5fc584 100644
--- a/keyboards/kyria/keymaps/plattfot/config.h
+++ b/keyboards/kyria/keymaps/plattfot/config.h
@@ -1,4 +1,5 @@
1/* Copyright 2019 Thomas Baart <thomas@splitkb.com> 1/* Copyright 2019 Thomas Baart <thomas@splitkb.com>
2 * Copyright 2020-2021 Fredrik Salomonsson <plattfot@gmail.com>
2 * 3 *
3 * This program is free software: you can redistribute it and/or modify 4 * 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 * it under the terms of the GNU General Public License as published by
@@ -37,4 +38,7 @@
37#define LEADER_PER_KEY_TIMING 38#define LEADER_PER_KEY_TIMING
38#define LEADER_TIMEOUT 350 39#define LEADER_TIMEOUT 350
39 40
40#define TAPPING_TERM 200 41// Remove the delay for the OSL keys. Not using any other tap keys.
42// Otherwise TAPPING_TERM_PER_KEY would be the way to go.
43#define TAPPING_TERM 0
44
diff --git a/keyboards/kyria/keymaps/plattfot/keymap.c b/keyboards/kyria/keymaps/plattfot/keymap.c
index 0fb305300..78e30c156 100644
--- a/keyboards/kyria/keymaps/plattfot/keymap.c
+++ b/keyboards/kyria/keymaps/plattfot/keymap.c
@@ -1,4 +1,4 @@
1/* Copyright 2020 Fredrik Salomonsson <plattfot@gmail.com> 1/* Copyright 2020-2021 Fredrik Salomonsson <plattfot@gmail.com>
2 * 2 *
3 * This program is free software: you can redistribute it and/or modify 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 4 * it under the terms of the GNU General Public License as published by
@@ -18,19 +18,26 @@
18 18
19enum custom_keycodes { 19enum custom_keycodes {
20 PLACEHOLDER = SAFE_RANGE, // can always be here 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 21 // New keys
28 DBL_TAP, // Repeat next key 22 CLO_TAP, // Close the next key press
29}; 23};
30 24
31// Double Tap feature based on post from drashna 25// Close tap feature based on a post from drashna
32// https://www.reddit.com/r/olkb/comments/citkbx/double_key_press_modifier_qmkwould_work_like/ev9cue8/ 26// https://www.reddit.com/r/olkb/comments/citkbx/double_key_press_modifier_qmkwould_work_like/ev9cue8/
33static bool double_tap_it = false; 27// Will insert the closing equivalent key and move the cursor inside.
28// For example clo_tap and then ( will result in (|), where | is the
29// cursor. For " it will be "|" as the close equivalent key is the
30// same key.
31enum close_tap_modes {
32 CLO_DISABLED = 0b000,
33 CLO_PRESSED = 0b001, // Close tap key is pressed
34 CLO_ACTIVE = 0b010, // Close tap next keypress
35 CLO_USED = 0b100, // Turn off when close tap key is released
36};
37
38#define CLO_RELEASE(flag) flag & ~CLO_PRESSED
39
40static enum close_tap_modes close_tap_it = CLO_DISABLED;
34 41
35enum layers { 42enum layers {
36 _DEFAULT, 43 _DEFAULT,
@@ -40,89 +47,97 @@ enum layers {
40 _ADJUST, 47 _ADJUST,
41}; 48};
42 49
50#define MO_ADJT MO(_ADJUST)
51#define L_RAISE OSL(_RAISE)
52#define L_LOWER OSL(_LOWER)
53#define L_NAV MO(_NAV)
54#define EU_TDOT RSA(KC_SLSH)
55#define EU_CDOT RALT(KC_EQUAL)
56#define EU_DEG RALT(KC_SCLN)
57
43// clang-format off 58// clang-format off
44const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { 59const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
45/* 60/*
46 * Base Layer: Default 61 * Base Layer: Default
47 * 62 *
48 * ,-------------------------------------------. ,-------------------------------------------. 63 * ,-------------------------------------------. ,-------------------------------------------.
49 * | ` | Q | W | E | R | T | | Y | U | I | O | P | Å | 64 * | Esc | Q | W | E | R | T | | Y | U | I | O | P | Del |
50 * |--------+------+------+------+------+------| |------+------+------+------+------+--------| 65 * |--------+------+------+------+------+------| |------+------+------+------+------+--------|
51 * | Tab | A | S | D | F | G | | H | J | K | L | ; : | ' " | 66 * | Tab | A | S | D | F | G | | H | J | K | L | ; | ' |
52 * |--------+------+------+------+------+------+-------------. ,-------------+------+------+------+------+------+--------| 67 * |--------+------+------+------+------+------+-------------. ,-------------+------+------+------+------+------+--------|
53 * | LShift | Z | X | C | V | B | Lead | RAISE| | LOWER|DBLTAP| N | M | , < | . > | / ? | RShift | 68 * | LShift | Z | X | C | V | B | Lead | RAISE| | LOWER|BSpace| N | M | , | . | / | RShift |
54 * `----------------------+------+------+------+------+------| |------+------+------+------+------+----------------------' 69 * `----------------------+------+------+------+------+------| |------+------+------+------+------+----------------------'
55 * | MPlay| GUI | LCtrl| Space| LALT | | Enter|BSpace| NAV |LCTL+ |Worksp| 70 * | MPlay| GUI | LCtrl| Space| LALT | | RCtrl| Enter| NAV | RALT |Scroll|
56 * | | | | | | | | | |LALT |toggle| 71 * | | | | | | | | | | | Lock |
57 * `----------------------------------' `----------------------------------' 72 * `----------------------------------' `----------------------------------'
58 */ 73 */
59 [_DEFAULT] = LAYOUT( 74 [_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, 75 KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_DEL,
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, 76 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, 77 KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_LEAD, L_RAISE, L_LOWER, KC_BSPC, 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) 78 KC_MPLY,KC_LGUI,KC_LCTL, KC_SPACE, KC_LALT, KC_RCTL, KC_ENT, L_NAV, KC_RALT, KC_SLCK
64 ), 79 ),
65 80
66/* 81/*
67 * Lower Layer: Symbols 82 * Lower Layer: Left symbols
68 * 83 *
69 * ,-------------------------------------------. ,-------------------------------------------. 84 * ,-------------------------------------------. ,-------------------------------------------.
70 * | ~ | ! | @ | # | $ | % | | ^ | & | * | ( | ) | | 85 * | | ! | @ | # | $ | % | | F6 | F7 | F8 | F9 | F10 | |
71 * |--------+------+------+------+------+------| |------+------+------+------+------+--------| 86 * |--------+------+------+------+------+------| |------+------+------+------+------+--------|
72 * | | | | _ | \ | - | + | | = | { | } | [ | ] | '' | 87 * | | | | _ | \ | - | + | | F12 | | | | | |
73 * |--------+------+------+------+------+------+-------------. ,-------------+------+------+------+------+------+--------| 88 * |--------+------+------+------+------+------+-------------. ,-------------+------+------+------+------+------+--------|
74 * | | [] | {} | () | <> | | | | | | | | | < | > | ? | | 89 * | | ° | : | ( | ) | × | |ADJUST| | | |CLOTAP| | | | | |
75 * `----------------------+------+------+------+------+------| |------+------+------+------+------+----------------------' 90 * `----------------------+------+------+------+------+------| |------+------+------+------+------+----------------------'
76 * | Mute | | | | | | | | | | | 91 * | | | | | | | | | | | |
77 * | | | | | | | | | | | | 92 * | | | | | | | | | | | |
78 * `----------------------------------' `----------------------------------' 93 * `----------------------------------' `----------------------------------'
79 */ 94 */
80 [_LOWER] = LAYOUT( 95 [_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, _______, 96 _______, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, _______,
82 _______, KC_PIPE, KC_UNDS, KC_BSLS, KC_MINS, KC_PLUS, KC_EQUAL,KC_LCBR, KC_RCBR, KC_LBRC, KC_RBRC, M_DQUOT, 97 _______, KC_PIPE, KC_UNDS, KC_BSLS, KC_MINS, KC_PLUS, KC_F12, _______, _______, _______, _______, _______,
83 _______, M_LRBRC, M_LRCBR, M_LRPRN, M_LRABR, _______, _______, _______, _______, _______, _______, _______, KC_LT, KC_GT, KC_QUES, _______, 98 _______, EU_DEG, KC_COLN, KC_LPRN, KC_RPRN, EU_CDOT, _______, MO_ADJT, _______, _______, CLO_TAP, _______, _______, _______, _______, _______,
84 KC_MUTE, _______, _______, _______, _______, _______, _______, _______, _______, _______ 99 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
85 ), 100 ),
86/* 101/*
87 * Raise Layer: Function keys 102 * Raise Layer: Right symbols + state
88 * 103 *
89 * ,-------------------------------------------. ,-------------------------------------------. 104 * ,-------------------------------------------. ,-------------------------------------------.
90 * | | F1 | F2 | F3 | F4 | F5 | | F6 | F7 | F8 | F9 | F10 | | 105 * | | F1 | F2 | F3 | F4 | F5 | | ^ | & | * | ~ | ? | |
91 * |--------+------+------+------+------+------| |------+------+------+------+------+--------| 106 * |--------+------+------+------+------+------| |------+------+------+------+------+--------|
92 * | | | | | | F11 | | F12 | | | | | | 107 * | | | | | | F11 | | = | { | } | [ | ] | ` |
93 * |--------+------+------+------+------+------+-------------. ,-------------+------+------+------+------+------+--------| 108 * |--------+------+------+------+------+------+-------------. ,-------------+------+------+------+------+------+--------|
94 * | | | | | | |ScLock| | | | Ins | | | | | |CapsLock| 109 * | | | | | |CLOTAP| | | |ADJUST| | | " | < | > | / |CapsLock|
95 * `----------------------+------+------+------+------+------| |------+------+------+------+------+----------------------' 110 * `----------------------+------+------+------+------+------| |------+------+------+------+------+----------------------'
96 * | | | | | | | | | | RAlt | | 111 * | Mute | | | | | | | | | |Insert|
97 * | | | | | | | | | | | | 112 * | | | | | | | | | | | |
98 * `----------------------------------' `----------------------------------' 113 * `----------------------------------' `----------------------------------'
99 */ 114 */
100 [_RAISE] = LAYOUT( 115 [_RAISE] = LAYOUT(
101 _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, _______, 116 _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_CIRC, KC_AMPR, KC_ASTR, KC_TILDE,KC_QUES, _______,
102 _______, _______, _______, _______, _______, KC_F11, KC_F12, _______, _______, _______, _______, _______, 117 _______, _______, _______, _______, _______, KC_F11, KC_EQUAL,KC_LCBR, KC_RCBR, KC_LBRC, KC_RBRC, KC_GRV,
103 _______, _______, _______, _______, _______, _______, KC_SLCK, _______, _______, KC_INS, _______, _______, _______, _______, _______, KC_CAPS, 118 _______, _______, _______, _______, _______, CLO_TAP, _______, _______, MO_ADJT, _______, EU_TDOT, KC_DQUO, KC_LT, KC_GT, _______, KC_CAPS,
104 _______, _______, _______, _______, _______, _______, _______, _______, KC_RALT, _______ 119 KC_MUTE, _______, _______, _______, _______, _______, _______, _______, _______, KC_INS
105 120
106 ), 121 ),
107/* 122/*
108 * Navigation Layer: Number keys, navigation, modification 123 * Navigation Layer: Number/Function keys, navigation
109 * 124 *
110 * ,-------------------------------------------. ,-------------------------------------------. 125 * ,-------------------------------------------. ,-------------------------------------------.
111 * | | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | | 126 * | | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | |
112 * |--------+------+------+------+------+------| |------+------+------+------+------+--------| 127 * |--------+------+------+------+------+------| |------+------+------+------+------+--------|
113 * | | | Esc | Del | | | | | Left | Up | Down | Right| | 128 * | | | | | | | | | Left | Up | Down | Right| |
114 * |--------+------+------+------+------+------+-------------. ,-------------+------+------+------+------+------+--------| 129 * |--------+------+------+------+------+------+-------------. ,-------------+------+------+------+------+------+--------|
115 * | | | | | | | | | | | | | | | | | | 130 * | | | | | | | | | | | | | | | | | |
116 * `----------------------+------+------+------+------+------| |------+------+------+------+------+----------------------' 131 * `----------------------+------+------+------+------+------| |------+------+------+------+------+----------------------'
117 * | | | | | | | | | | RCtrl| | 132 * | | | | | | | | | | | |
118 * | | | | | | | | | | | | 133 * | | | | | | | | | | | |
119 * `----------------------------------' `----------------------------------' 134 * `----------------------------------' `----------------------------------'
120 */ 135 */
121 [_NAV] = LAYOUT( 136 [_NAV] = LAYOUT(
122 _______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______, 137 _______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______,
123 _______, _______, KC_ESC, KC_DEL, _______, _______, _______, KC_LEFT, KC_UP, KC_DOWN, KC_RGHT, _______, 138 _______, _______, _______, _______, _______, _______, _______, KC_LEFT, KC_UP, KC_DOWN, KC_RGHT, _______,
124 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, 139 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
125 _______, _______, _______, _______, _______, _______, _______, _______, KC_RCTL, _______ 140 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
126 ), 141 ),
127/* 142/*
128 * Adjust Layer: RGB 143 * Adjust Layer: RGB
@@ -173,67 +188,81 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
173bool process_record_user(uint16_t keycode, keyrecord_t *record) { 188bool process_record_user(uint16_t keycode, keyrecord_t *record) {
174 if (record->event.pressed) { 189 if (record->event.pressed) {
175 switch (keycode) { 190 switch (keycode) {
176 case M_LRPRN: 191 case CLO_TAP:
177 // Double tap gets messed up with macros, turning it off 192 close_tap_it = close_tap_it & CLO_ACTIVE?
178 double_tap_it = false; 193 CLO_USED:
179 SEND_STRING("()" SS_TAP(X_LEFT)); 194 CLO_ACTIVE|CLO_PRESSED;
180 return false;
181 case M_LRCBR:
182 double_tap_it = false;
183 SEND_STRING("{}" SS_TAP(X_LEFT));
184 return false;
185 case M_LRBRC:
186 double_tap_it = false;
187 SEND_STRING("[]" SS_TAP(X_LEFT));
188 return false;
189 case M_LRABR:
190 double_tap_it = false;
191 SEND_STRING("<>" SS_TAP(X_LEFT));
192 return false;
193 case M_DQUOT:
194 double_tap_it = false;
195 SEND_STRING("''" SS_TAP(X_LEFT));
196 return false;
197 case DBL_TAP:
198 double_tap_it = !double_tap_it;
199 return false; 195 return false;
200 case KC_LEAD: 196 case KC_LEAD:
201 double_tap_it = false; 197 close_tap_it = CLO_DISABLED;
202 return true; 198 return true;
203 } 199 }
204 200 } else if (close_tap_it & CLO_ACTIVE &&
205 } else if (double_tap_it && 201 keycode != CLO_TAP &&
206 keycode != DBL_TAP &&
207 keycode != OSL(_RAISE) && 202 keycode != OSL(_RAISE) &&
208 keycode != OSL(_LOWER) && 203 keycode != OSL(_LOWER) &&
209 keycode != MO(_NAV)) { 204 keycode != MO(_NAV)) {
210 double_tap_it = false; 205
211 tap_code16(keycode); 206 close_tap_it = close_tap_it & CLO_PRESSED?
207 close_tap_it | CLO_USED:
208 CLO_DISABLED;
209 switch(keycode)
210 {
211 case KC_LPRN:
212 tap_code16(KC_RPRN);
213 tap_code16(KC_LEFT);
214 break;
215 case KC_RPRN:
216 tap_code16(KC_LEFT);
217 tap_code16(KC_LPRN);
218 break;
219 case KC_LCBR:
220 tap_code16(KC_RCBR);
221 tap_code16(KC_LEFT);
222 break;
223 case KC_RCBR:
224 tap_code16(KC_LEFT);
225 tap_code16(KC_LCBR);
226 break;
227 case KC_LBRC:
228 tap_code16(KC_RBRC);
229 tap_code16(KC_LEFT);
230 break;
231 case KC_RBRC:
232 tap_code16(KC_LEFT);
233 tap_code16(KC_LBRC);
234 break;
235 case KC_LT:
236 tap_code16(KC_GT);
237 tap_code16(KC_LEFT);
238 break;
239 case KC_GT:
240 tap_code16(KC_LEFT);
241 tap_code16(KC_LT);
242 break;
243 default:
244 tap_code16(keycode);
245 tap_code16(KC_LEFT);
246 break;
247 }
248 } else {
249 switch (keycode) {
250 case CLO_TAP:
251 close_tap_it = close_tap_it & CLO_USED?
252 CLO_DISABLED:
253 CLO_RELEASE(close_tap_it);
254 }
212 } 255 }
213 256
214 return true; 257 return true;
215} 258}
216 259
217layer_state_t layer_state_set_user(layer_state_t state) { return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); } 260//layer_state_t layer_state_set_user(layer_state_t state) { return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); }
218 261
219#ifdef OLED_DRIVER_ENABLE 262#ifdef OLED_DRIVER_ENABLE
220oled_rotation_t oled_init_user(oled_rotation_t rotation) { return OLED_ROTATION_180; } 263oled_rotation_t oled_init_user(oled_rotation_t rotation) { return OLED_ROTATION_180; }
221 264
222// clang-format off 265// clang-format off
223static void render_kyria_logo(void) {
224 static const char PROGMEM kyria_logo[] = {
225 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,
226 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,
227 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,
228 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,
229 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,
230 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,
231 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,
232 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
233 };
234 oled_write_raw_P(kyria_logo, sizeof(kyria_logo));
235}
236
237static void render_qmk_logo(void) { 266static void render_qmk_logo(void) {
238 static const char PROGMEM qmk_logo[] = { 267 static const char PROGMEM qmk_logo[] = {
239 0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f,0x90,0x91,0x92,0x93,0x94, 268 0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f,0x90,0x91,0x92,0x93,0x94,
@@ -243,6 +272,11 @@ static void render_qmk_logo(void) {
243 oled_write_P(qmk_logo, false); 272 oled_write_P(qmk_logo, false);
244} 273}
245// clang-format on 274// clang-format on
275static void render_static_info(void) {
276 render_qmk_logo();
277 oled_write_P(PSTR("Kyria rev1.0\n"), false);
278 oled_write_P(PSTR("Keymap: plattfot v2\n"), false);
279}
246 280
247static void render_status(void) { 281static void render_status(void) {
248 // QMK Logo and version information 282 // QMK Logo and version information
@@ -254,16 +288,16 @@ static void render_status(void) {
254 oled_write_P(PSTR("Layer: "), false); 288 oled_write_P(PSTR("Layer: "), false);
255 switch (get_highest_layer(layer_state)) { 289 switch (get_highest_layer(layer_state)) {
256 case _DEFAULT: 290 case _DEFAULT:
257 oled_write_P(PSTR("plattfot\n"), false); 291 oled_write_P(PSTR("base\n"), false);
258 break; 292 break;
259 case _LOWER: 293 case _LOWER:
260 oled_write_P(PSTR("symbols\n"), false); 294 oled_write_P(PSTR("<-sym/fun->\n"), false);
261 break; 295 break;
262 case _RAISE: 296 case _RAISE:
263 oled_write_P(PSTR("function keys\n"), false); 297 oled_write_P(PSTR("<-fun/sym->\n"), false);
264 break; 298 break;
265 case _NAV: 299 case _NAV:
266 oled_write_P(PSTR("numbers/navi\n"), false); 300 oled_write_P(PSTR("num/nav\n"), false);
267 break; 301 break;
268 case _ADJUST: 302 case _ADJUST:
269 oled_write_P(PSTR("adjust\n"), false); 303 oled_write_P(PSTR("adjust\n"), false);
@@ -276,15 +310,15 @@ static void render_status(void) {
276 led_t led_state = host_keyboard_led_state(); 310 led_t led_state = host_keyboard_led_state();
277 if (led_state.num_lock) { 311 if (led_state.num_lock) {
278 oled_write_P(PSTR("NUMLCK "), false); 312 oled_write_P(PSTR("NUMLCK "), false);
279 } else if (double_tap_it) { 313 } else if (close_tap_it) {
280 oled_write_P(PSTR("Double "), false); 314 oled_write_P(PSTR("Close "), false);
281 } else { 315 } else {
282 oled_write_P(PSTR(" "), false); 316 oled_write_P(PSTR(" "), false);
283 } 317 }
284 318
285 if (led_state.caps_lock) { 319 if (led_state.caps_lock) {
286 oled_write_P(PSTR("CAPLCK "), false); 320 oled_write_P(PSTR("CAPLCK "), false);
287 } else if (double_tap_it) { 321 } else if (close_tap_it) {
288 oled_write_P(PSTR("Tap "), false); 322 oled_write_P(PSTR("Tap "), false);
289 } else { 323 } else {
290 oled_write_P(PSTR(" "), false); 324 oled_write_P(PSTR(" "), false);
@@ -297,7 +331,7 @@ void oled_task_user(void) {
297 if (is_keyboard_master()) { 331 if (is_keyboard_master()) {
298 render_status(); // Renders the current keyboard state (layer, lock, caps, scroll, etc) 332 render_status(); // Renders the current keyboard state (layer, lock, caps, scroll, etc)
299 } else { 333 } else {
300 render_kyria_logo(); 334 render_static_info();
301 } 335 }
302} 336}
303#endif 337#endif
@@ -316,6 +350,16 @@ bool encoder_update_user(uint8_t index, bool clockwise) {
316 clear_oneshot_layer_state(ONESHOT_OTHER_KEY_PRESSED); 350 clear_oneshot_layer_state(ONESHOT_OTHER_KEY_PRESSED);
317 } 351 }
318 break; 352 break;
353 case _NAV:
354 // Brightness control
355 if (clockwise) {
356 tap_code(KC_BRIU);
357 clear_oneshot_layer_state(ONESHOT_OTHER_KEY_PRESSED);
358 } else {
359 tap_code(KC_BRID);
360 clear_oneshot_layer_state(ONESHOT_OTHER_KEY_PRESSED);
361 }
362 break;
319 default: 363 default:
320 // Volume control 364 // Volume control
321 if (clockwise) { 365 if (clockwise) {
@@ -330,13 +374,12 @@ bool encoder_update_user(uint8_t index, bool clockwise) {
330 } else if (index == 1) { 374 } else if (index == 1) {
331 switch (get_highest_layer(layer_state)) { 375 switch (get_highest_layer(layer_state)) {
332 case _RAISE: 376 case _RAISE:
333 // Credit to Thomas Baart for this 377 // Scroll through the workspaces
334 // See https://docs.splitkb.com/hc/en-us/articles/360010513760-How-can-I-use-a-rotary-encoder-
335 if (clockwise) { 378 if (clockwise) {
336 tap_code16(C(KC_TAB)); 379 tap_code16(G(KC_GT));
337 clear_oneshot_layer_state(ONESHOT_OTHER_KEY_PRESSED); 380 clear_oneshot_layer_state(ONESHOT_OTHER_KEY_PRESSED);
338 } else { 381 } else {
339 tap_code16(S(C(KC_TAB))); 382 tap_code16(G(KC_LT));
340 clear_oneshot_layer_state(ONESHOT_OTHER_KEY_PRESSED); 383 clear_oneshot_layer_state(ONESHOT_OTHER_KEY_PRESSED);
341 } 384 }
342 break; 385 break;