aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjohn-ezra <47311764+john-ezra@users.noreply.github.com>2021-09-11 07:31:24 -0700
committerGitHub <noreply@github.com>2021-09-11 07:31:24 -0700
commit5eb500a877d367d6b93f733db6068c3791b663b7 (patch)
tree716083d9ff5cab72b6ad704f36b1f44b2ac01b3d
parent35bff470f73e5041f4e969f5dae5f60d4c1ea3e0 (diff)
downloadqmk_firmware-5eb500a877d367d6b93f733db6068c3791b663b7.tar.gz
qmk_firmware-5eb500a877d367d6b93f733db6068c3791b663b7.zip
[Keymap] Add john-ezra Kyria Keymap (#14338)
Co-authored-by: Drashna Jaelre <drashna@live.com> Co-authored-by: Ryan <fauxpark@gmail.com>
-rw-r--r--keyboards/splitkb/kyria/keymaps/john-ezra/config.h43
-rw-r--r--keyboards/splitkb/kyria/keymaps/john-ezra/keymap.c213
-rw-r--r--keyboards/splitkb/kyria/keymaps/john-ezra/oled.c143
-rw-r--r--keyboards/splitkb/kyria/keymaps/john-ezra/rules.mk11
4 files changed, 410 insertions, 0 deletions
diff --git a/keyboards/splitkb/kyria/keymaps/john-ezra/config.h b/keyboards/splitkb/kyria/keymaps/john-ezra/config.h
new file mode 100644
index 000000000..3602b560c
--- /dev/null
+++ b/keyboards/splitkb/kyria/keymaps/john-ezra/config.h
@@ -0,0 +1,43 @@
1/* Copyright 2021 John Ezra
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_EFFECT_BREATHING
25#define RGBLIGHT_EFFECT_RAINBOW_MOOD
26#define RGBLIGHT_EFFECT_RAINBOW_SWIRL
27#define RGBLIGHT_EFFECT_SNAKE
28#define RGBLIGHT_EFFECT_KNIGHT
29#define RGBLIGHT_EFFECT_CHRISTMAS
30#define RGBLIGHT_EFFECT_STATIC_GRADIENT
31#define RGBLIGHT_EFFECT_RGB_TEST
32#define RGBLIGHT_EFFECT_ALTERNATING
33#define RGBLIGHT_EFFECT_TWINKLE
34 #define RGBLIGHT_HUE_STEP 8
35 #define RGBLIGHT_SAT_STEP 8
36 #define RGBLIGHT_VAL_STEP 8
37 #define RGBLIGHT_LIMIT_VAL 150
38#endif
39
40#undef DEBOUNCE
41#define DEBOUNCE 1
42
43#define SPLIT_WPM_ENABLE
diff --git a/keyboards/splitkb/kyria/keymaps/john-ezra/keymap.c b/keyboards/splitkb/kyria/keymaps/john-ezra/keymap.c
new file mode 100644
index 000000000..3664fdfac
--- /dev/null
+++ b/keyboards/splitkb/kyria/keymaps/john-ezra/keymap.c
@@ -0,0 +1,213 @@
1/* Copyright 2021 John Ezra
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#include QMK_KEYBOARD_H
18
19enum kyria_layers {
20 _HNTS,
21 _QWERTY,
22 _LOWER,
23 _RAISE,
24 _ADJUST
25};
26
27enum kyria_keycodes {
28 HNTS = SAFE_RANGE,
29 QWERTY,
30 LOWER,
31 RAISE,
32 CPY_PST,
33 UNDO
34};
35
36#define BSP_CMD MT(MOD_LGUI, KC_BSPC)
37#define SFT_ENT MT(MOD_LSFT, KC_ENT)
38#define UNDO G(KC_Z)
39#define FIND G(KC_F)
40
41const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
42
43/*
44 * Default: HNTS
45 *
46 * ,-----------------------------------------------. ,-----------------------------------------------.
47 * | ` | Z | R | L | D | W | | Y | P | U | X | Q | | \ |
48 * |-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------|
49 * | Esc | H | N | T | S | C | | B | I | E | O | A | Esc |
50 * |-------+-------+-------+-------+-------+-------+---------------. ,---------------+-------+-------+-------+-------+-------+-------|
51 * |Cpy/Pst| K | V | M | F | G | Ctrl | Alt | | Caps | Del | J | ; : | , < | . > | / ? | ' " |
52 * `-------+-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-----------------------'
53 * | Up | Down | Lower | Space | BSPC | | Tab | Shift | Raise | Left | Right |
54 * `---------------------------------------' `---------------------------------------'
55 */
56
57[_HNTS] = LAYOUT(
58 FIND, KC_Z, KC_R, KC_L, KC_D, KC_W, KC_Y, KC_P, KC_U, KC_X, KC_Q, KC_BSLS,
59 CPY_PST, KC_H, KC_N, KC_T, KC_S, KC_C, KC_B, KC_I, KC_E, KC_O, KC_A, KC_ESC,
60 UNDO, KC_K, KC_V, KC_M, KC_F, KC_G, KC_LCTL, KC_LALT, KC_CAPS, KC_DEL, KC_J, KC_SCLN, KC_COMM, KC_DOT, KC_SLSH, KC_QUOT,
61 KC_UP, KC_DOWN, LOWER, KC_SPC, BSP_CMD, KC_TAB, SFT_ENT, RAISE, KC_LEFT, KC_RGHT
62),
63
64/*
65 * Default: QWERTY
66 *
67 * ,-----------------------------------------------. ,-----------------------------------------------.
68 * | ` | Q | W | E | R | T | | Y | U | I | O | P | | \ |
69 * |-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------|
70 * | Esc | A | S | D | F | G | | H | J | K | L | ; | ' " |
71 * |-------+-------+-------+-------+-------+-------+---------------. ,---------------+-------+-------+-------+-------+-------+-------|
72 * |Cpy/Pst| Z | X | C | V | B | Ctrl | Alt | | Caps | Del | N | M | , < | . > | / ? |Cpy/Pst|
73 * `-------+-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-----------------------'
74 * | Up | Down | Lower | Space | BSPC | | Tab | Shift | Raise | Left | Right |
75 * `---------------------------------------' `---------------------------------------'
76 */
77
78[_QWERTY] = LAYOUT(
79 KC_GRV, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS,
80 KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT,
81 CPY_PST, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_LCTL, KC_LALT, KC_CAPS, KC_DEL, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, CPY_PST,
82 KC_UP, KC_DOWN, LOWER, KC_SPC, BSP_CMD, KC_TAB, SFT_ENT, RAISE, KC_LEFT, KC_RGHT
83),
84
85/*
86 * Lower: Symbols
87 *
88 * ,-----------------------------------------------. ,-----------------------------------------------.
89 * | | ! | @ | { | } | | | | | | | | | | \ |
90 * |-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------|
91 * | | # | $ | ( | ) | ` ~ | | + | - | * | / | = | |
92 * |-------+-------+-------+-------+-------+-------+---------------. ,---------------+-------+-------+-------+-------+-------+-------|
93 * | | % | ^ | [ | ] | & | | | | | | | | | | | |
94 * `-------+-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-----------------------'
95 * | | | | | | | | | | | |
96 * `---------------------------------------' `---------------------------------------'
97 */
98
99[_LOWER] = LAYOUT(
100 KC_GRV, KC_EXLM, KC_AT, KC_LCBR, KC_RCBR, KC_PIPE, _______, _______, _______, _______, _______, _______,
101 KC_TILD, KC_HASH, KC_DLR, KC_LPRN, KC_RPRN, KC_BSLS, KC_PLUS, KC_MINS, KC_ASTR, KC_SLSH, KC_EQL, _______,
102 KC_AMPR, KC_PERC, KC_CIRC, KC_LBRC, KC_RBRC, KC_UNDS, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
103 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
104),
105
106/*
107 * Raise: Numbers & Media
108 *
109 * ,-----------------------------------------------. ,-----------------------------------------------.
110 * | | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | |
111 * |-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------|
112 * | | Prev | Play | Next | VolUp | Mute | |Bright+| Left | Down | Up | Right | |
113 * |-------+-------+-------+-------+-------+-------+---------------. ,---------------+-------+-------+-------+-------+-------+-------|
114 * | | | | | VolDn | | | | | | |Bright-| | | | | |
115 * `-------+-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-----------------------'
116 * | | | | | | | | | | | |
117 * `---------------------------------------' `---------------------------------------'
118 */
119
120[_RAISE] = LAYOUT(
121 _______, _______, _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, _______,
122 _______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______,
123 KC_VOLD, KC_VOLU, KC_MPRV, KC_MPLY, KC_MNXT, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
124 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
125),
126
127 /*
128 * Adjust: Function Keys & RGB
129 *
130 * ,-----------------------------------------------. ,-----------------------------------------------.
131 * | | F1 | F2 | F3 | F4 | F5 | | F6 | F7 | F8 | F9 | F10 | |
132 * |-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------|
133 * | | TOG | SAI | HUI | VAI | MOD | | | | | F11 | F12 | NKRO |
134 * |-------+-------+-------+-------+-------+-------+---------------. ,---------------+-------+-------+-------+-------+-------+-------|
135 * | | | SAD | HUD | VAD | RMOD | | | | | | | | | | | |
136 * `-------+-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-----------------------'
137 * | | | | | | | | | | | |
138 * `---------------------------------------' `---------------------------------------'
139 */
140
141[_ADJUST] = LAYOUT(
142 _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, NK_TOGG,
143 _______, RGB_TOG, RGB_SAI, RGB_HUI, RGB_VAI, RGB_MOD, KC_BRIU, _______, _______, KC_F11, KC_F12, CG_TOGG,
144 _______, _______, RGB_SAD, RGB_HUD, RGB_VAD,RGB_RMOD,_______, _______, _______, _______, KC_BRID, _______, _______, _______, QWERTY, HNTS,
145 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
146),
147};
148
149bool process_record_user(uint16_t keycode, keyrecord_t *record) {
150 switch (keycode) {
151 case HNTS: //Layer Control
152 if (record->event.pressed) {
153 set_single_persistent_default_layer(_HNTS);
154 }
155 return false;
156 break;
157 case QWERTY:
158 if (record->event.pressed) {
159 set_single_persistent_default_layer(_QWERTY);
160 }
161 return false;
162 break;
163 case LOWER:
164 if (record->event.pressed) {
165 layer_on(_LOWER);
166 update_tri_layer(_LOWER, _RAISE, _ADJUST);
167 } else {
168 layer_off(_LOWER);
169 update_tri_layer(_LOWER, _RAISE, _ADJUST);
170 }
171 return false;
172 break;
173 case RAISE:
174 if (record->event.pressed) {
175 layer_on(_RAISE);
176 update_tri_layer(_LOWER, _RAISE, _ADJUST);
177 } else {
178 layer_off(_RAISE);
179 update_tri_layer(_LOWER, _RAISE, _ADJUST);
180 }
181 return false;
182 break;
183 case CPY_PST: // One key copy/paste
184 {
185 static uint16_t copy_paste_timer;
186 if (record->event.pressed) {
187 copy_paste_timer = timer_read();
188 } else {
189 if (timer_elapsed(copy_paste_timer) > TAPPING_TERM) { // Hold, copy
190 register_mods(mod_config(MOD_LGUI));
191 tap_code(KC_C);
192 unregister_mods(mod_config(MOD_LGUI));
193 } else { // Tap, paste
194 register_mods(mod_config(MOD_LGUI));
195 tap_code(KC_V);
196 unregister_mods(mod_config(MOD_LGUI));
197 }
198 }
199 }
200 break;
201 case UNDO: // Undo Redo
202 if ((get_mods() & MOD_BIT(KC_LGUI)) == MOD_BIT(KC_LGUI)) {
203 if (record->event.pressed) {
204 register_code(KC_Y);
205 } else {
206 unregister_code(KC_Y);
207 }
208 return false;
209 }
210 return true;
211 }
212 return true;
213};
diff --git a/keyboards/splitkb/kyria/keymaps/john-ezra/oled.c b/keyboards/splitkb/kyria/keymaps/john-ezra/oled.c
new file mode 100644
index 000000000..d98cd598b
--- /dev/null
+++ b/keyboards/splitkb/kyria/keymaps/john-ezra/oled.c
@@ -0,0 +1,143 @@
1/* Copyright 2021 John Ezra
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//Sets up what the OLED screens display.
18
19#include QMK_KEYBOARD_H
20
21int timer = 0;
22char wpm_counter[5];
23int x = 31;
24int currwpm = 0;
25int vert_count = 0;
26
27//============= USER CONFIG PARAMS ===============
28float max_wpm = 150.0f; //WPM value at the top of the graph window
29int graph_refresh_interval = 80; //in milliseconds
30int graph_area_fill_interval = 3; //determines how dense the horizontal lines under the graph line are; lower = more dense
31int vert_interval = 3; //determines frequency of vertical lines under the graph line
32bool vert_line = false; //determines whether to draw vertical lines
33int graph_line_thickness = 2; //determines thickness of graph line in pixels
34//============= END USER PARAMS ===============
35
36#ifdef OLED_ENABLE
37oled_rotation_t oled_init_user(oled_rotation_t rotation) {
38 return OLED_ROTATION_180;
39}
40
41static void render_qmk_logo(void) {
42 static const char PROGMEM qmk_logo[] = {
43 0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f,0x90,0x91,0x92,0x93,0x94,
44 0xa0,0xa1,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7,0xa8,0xa9,0xaa,0xab,0xac,0xad,0xae,0xaf,0xb0,0xb1,0xb2,0xb3,0xb4,
45 0xc0,0xc1,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,0xca,0xcb,0xcc,0xcd,0xce,0xcf,0xd0,0xd1,0xd2,0xd3,0xd4,0};
46
47 oled_write_P(qmk_logo, false);
48}
49
50void render_bootmagic_status(void) {
51 oled_write_P((keymap_config.swap_lctl_lgui) ? PSTR("OS: Windows\n\n") : PSTR("OS: MacOS\n\n"), false);
52 oled_write_P((keymap_config.nkro) ? PSTR("NKRO ") : PSTR(" "), false);
53}
54
55void render_wpm(void) {
56 //get current WPM value
57 currwpm = get_current_wpm();
58 //check if it's been long enough before refreshing graph
59 if(timer_elapsed(timer) > graph_refresh_interval){
60 // main calculation to plot graph line
61 x = 64 - ((currwpm / max_wpm) * 64);
62 //first draw actual value line
63 for(int i = 0; i <= graph_line_thickness - 1; i++){
64 oled_write_pixel(1, x + i, true);
65 }
66 //then fill in area below the value line
67 if(vert_line){
68 if(vert_count == vert_interval){
69 vert_count = 0;
70 while(x <= 64){
71 oled_write_pixel(1, x, true);
72 x++;
73 }
74 } else {
75 for(int i = 64; i > x; i--){
76 if(i % graph_area_fill_interval == 0){
77 oled_write_pixel(1, i, true);
78 }
79 }
80 vert_count++;
81 }
82 } else {
83 for(int i = 64; i > x; i--){
84 if(i % graph_area_fill_interval == 0){
85 oled_write_pixel(1, i, true);
86 }
87 }
88 }
89 //then move the entire graph one pixel to the right
90 oled_pan(false);
91 //refresh the timer for the next iteration
92 timer = timer_read();
93 }
94 //format current WPM value into a printable string
95 char buf[4];
96 oled_set_cursor(14, 0);
97 oled_write("WPM:", false);
98 buf[0] = currwpm >= 100 ? ((currwpm/100) + '0') : ' ';
99 buf[1] = currwpm >= 10 ? (((currwpm/10) % 10) + '0') : ' ';
100 buf[2] = (currwpm % 10) + '0';
101 buf[3] = 0;
102 oled_write(buf, false);
103}
104
105static void render_status(void) {
106 // QMK Logo and version information
107 render_qmk_logo();
108 oled_write_P(PSTR("Kyria: Rev1.0\n"), false);
109
110 // Host Keyboard Layer Status
111 oled_write_P(PSTR("Layer: "), false);
112 switch (get_highest_layer(layer_state)) {
113 case 0:
114 oled_write_P(PSTR("Default\n"), false);
115 break;
116 case 2:
117 oled_write_P(PSTR("Lower\n"), false);
118 break;
119 case 3:
120 oled_write_P(PSTR("Raise\n"), false);
121 break;
122 case 4:
123 oled_write_P(PSTR("Adjust\n"), false);
124 break;
125 default:
126 oled_write_P(PSTR("Undefined\n"), false);
127 }
128
129 render_bootmagic_status();
130
131// Host Keyboard LED Status
132 led_t led_state = host_keyboard_led_state();
133 oled_write_P(led_state.caps_lock ? PSTR("CAPLCK ") : PSTR(" "), false);
134}
135
136void oled_task_user(void) {
137 if (is_keyboard_master()) {
138 render_status();
139 } else {
140 render_wpm();
141 }
142}
143#endif
diff --git a/keyboards/splitkb/kyria/keymaps/john-ezra/rules.mk b/keyboards/splitkb/kyria/keymaps/john-ezra/rules.mk
new file mode 100644
index 000000000..7fca028d2
--- /dev/null
+++ b/keyboards/splitkb/kyria/keymaps/john-ezra/rules.mk
@@ -0,0 +1,11 @@
1OLED_ENABLE = yes # Enables the use of OLED displays
2OLED_DRIVER = SSD1306
3RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow
4NKRO_ENABLE = yes # Enable N-Key Rollover
5ENCODER_ENABLE = no # Disable Rotary Encoder
6SPACE_CADET_ENABLE = no # Disable Space Cadet Shift
7GRAVE_ESC_ENABLE = no # Disable Grave Escape
8MOUSEKEY_ENABLE = no # Disable Mousekeys
9WPM_ENABLE = yes # Enable WPM Counter (Works with default wpm files, but works better with vectorstorm updated wpm.c and wpm.h -> https://github.com/vectorstorm/qmk_firmware/tree/wpm_exact)
10
11SRC += oled.c