diff options
author | William Chang <william@factual.com> | 2019-11-20 22:17:07 -0800 |
---|---|---|
committer | William Chang <william@factual.com> | 2019-11-20 22:17:07 -0800 |
commit | e7f4d56592b3975c38af329e77b4efd9108495e8 (patch) | |
tree | 0a416bccbf70bfdbdb9ffcdb3bf136b47378c014 /keyboards/kyria/keymaps | |
parent | 71493b2f9bbd5f3d18373c518fa14ccafcbf48fc (diff) | |
parent | 8416a94ad27b3ff058576f09f35f0704a8b39ff3 (diff) | |
download | firmware-e7f4d56592b3975c38af329e77b4efd9108495e8.tar.gz firmware-e7f4d56592b3975c38af329e77b4efd9108495e8.tar.bz2 firmware-e7f4d56592b3975c38af329e77b4efd9108495e8.zip |
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'keyboards/kyria/keymaps')
-rw-r--r-- | keyboards/kyria/keymaps/default/config.h | 32 | ||||
-rw-r--r-- | keyboards/kyria/keymaps/default/keymap.c | 219 | ||||
-rw-r--r-- | keyboards/kyria/keymaps/default/rules.mk | 3 | ||||
-rw-r--r-- | keyboards/kyria/keymaps/drashna/config.h | 38 | ||||
-rw-r--r-- | keyboards/kyria/keymaps/drashna/keymap.c | 372 | ||||
-rw-r--r-- | keyboards/kyria/keymaps/drashna/rules.mk | 22 | ||||
-rw-r--r-- | keyboards/kyria/keymaps/thomasbaart/config.h | 47 | ||||
-rw-r--r-- | keyboards/kyria/keymaps/thomasbaart/keymap.c | 333 | ||||
-rw-r--r-- | keyboards/kyria/keymaps/thomasbaart/rules.mk | 5 |
9 files changed, 1071 insertions, 0 deletions
diff --git a/keyboards/kyria/keymaps/default/config.h b/keyboards/kyria/keymaps/default/config.h new file mode 100644 index 000000000..f00bfa8e7 --- /dev/null +++ b/keyboards/kyria/keymaps/default/config.h @@ -0,0 +1,32 @@ +/* Copyright 2019 Thomas Baart <thomas@splitkb.com> + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#pragma once + +#ifdef OLED_DRIVER_ENABLE + #define OLED_DISPLAY_128X64 +#endif + +#ifdef RGBLIGHT_ENABLE + #define RGBLIGHT_ANIMATIONS + #define RGBLIGHT_HUE_STEP 8 + #define RGBLIGHT_SAT_STEP 8 + #define RGBLIGHT_VAL_STEP 8 +#endif + +// If you are using an Elite C rev3 on the slave side, uncomment the lines below: +// #define SPLIT_USB_DETECT +// #define NO_USB_STARTUP_CHECK diff --git a/keyboards/kyria/keymaps/default/keymap.c b/keyboards/kyria/keymaps/default/keymap.c new file mode 100644 index 000000000..acadb0422 --- /dev/null +++ b/keyboards/kyria/keymaps/default/keymap.c @@ -0,0 +1,219 @@ +/* Copyright 2019 Thomas Baart <thomas@splitkb.com> + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ +#include QMK_KEYBOARD_H + +enum layers { + _QWERTY = 0, + _LOWER, + _RAISE, + _ADJUST +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* + * Base Layer: QWERTY + * + * ,-------------------------------------------. ,-------------------------------------------. + * |RAIS/ESC| Q | W | E | R | T | | Y | U | I | O | P | | \ | + * |--------+------+------+------+------+------| |------+------+------+------+------+--------| + * |Ctrl/BS | A | S | D | F | G | | H | J | K | L | ; : | ' " | + * |--------+------+------+------+------+------+-------------. ,-------------+------+------+------+------+------+--------| + * | LShift | Z | X | C | V | B |LShift|LShift| |LShift|LShift| N | M | , < | . > | / ? | - _ | + * `----------------------+------+------+------+------+------| |------+------+------+------+------+----------------------' + * | GUI | Del | Enter| Space| Esc | | Enter| Space| Tab | Bksp | AltGr| + * | | | Alt | Lower| Raise| | Lower| Raise| | | | + * `----------------------------------' `----------------------------------' + */ + [_QWERTY] = LAYOUT( + LT(_RAISE, KC_ESC), KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_PIPE, + MT(MOD_LCTL, KC_BSPC), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_LSFT, KC_LSFT, KC_LSFT, KC_LSFT, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_MINS, + KC_LGUI, KC_DEL, MT(MOD_LALT, KC_ENT), LT(_LOWER, KC_SPC), LT(_RAISE, KC_ESC), LT(_LOWER, KC_ENT), LT(_RAISE, KC_SPC), KC_TAB, KC_BSPC, KC_RALT + ), +/* + * Lower Layer: Symbols + * + * ,-------------------------------------------. ,-------------------------------------------. + * | | ! | @ | { | } | | | | | | | | | | \ | + * |--------+------+------+------+------+------| |------+------+------+------+------+--------| + * | | # | $ | ( | ) | ` | | + | - | / | * | % | ' " | + * |--------+------+------+------+------+------+-------------. ,-------------+------+------+------+------+------+--------| + * | | % | ^ | [ | ] | ~ | | | | | | & | = | , | . | / ? | - _ | + * `----------------------+------+------+------+------+------| |------+------+------+------+------+----------------------' + * | | | | ; | = | | = | ; | | | | + * | | | | | | | | | | | | + * `----------------------------------' `----------------------------------' + */ + [_LOWER] = LAYOUT( + _______, KC_EXLM, KC_AT, KC_LCBR, KC_RCBR, KC_PIPE, _______, _______, _______, _______, _______, KC_BSLS, + _______, KC_HASH, KC_DLR, KC_LPRN, KC_RPRN, KC_GRV, KC_PLUS, KC_MINS, KC_SLSH, KC_ASTR, KC_PERC, KC_QUOT, + _______, KC_PERC, KC_CIRC, KC_LBRC, KC_RBRC, KC_TILD, _______, _______, _______, _______, KC_AMPR, KC_EQL, KC_COMM, KC_DOT, KC_SLSH, KC_MINS, + _______, _______, _______, KC_SCLN, KC_EQL, KC_EQL, KC_SCLN, _______, _______, _______ + ), +/* + * Raise Layer: Number keys, media, navigation + * + * ,-------------------------------------------. ,-------------------------------------------. + * | | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | | + * |--------+------+------+------+------+------| |------+------+------+------+------+--------| + * | | | Prev | Play | Next | VolUp| | Left | Down | Up | Right| | | + * |--------+------+------+------+------+------+-------------. ,-------------+------+------+------+------+------+--------| + * | | | | | Mute | VolDn| | | | | | MLeft| Mdown| MUp |MRight| | | + * `----------------------+------+------+------+------+------| |------+------+------+------+------+----------------------' + * | | | | | | | | | | | | + * | | | | | | | | | | | | + * `----------------------------------' `----------------------------------' + */ + [_RAISE] = LAYOUT( + _______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______, + _______, _______, KC_MPRV, KC_MPLY, KC_MNXT, KC_VOLU, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, _______, _______, + _______, _______, _______, _______, KC_MUTE, KC_VOLD, _______, _______, _______, _______, KC_MS_L, KC_MS_D, KC_MS_U, KC_MS_R, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), +/* + * Adjust Layer: Function keys, RGB + * + * ,-------------------------------------------. ,-------------------------------------------. + * | | F1 | F2 | F3 | F4 | F5 | | F6 | F7 | F8 | F9 | F10 | | + * |--------+------+------+------+------+------| |------+------+------+------+------+--------| + * | | TOG | SAI | HUI | VAI | MOD | | | | | F11 | F12 | | + * |--------+------+------+------+------+------+-------------. ,-------------+------+------+------+------+------+--------| + * | | | SAD | HUD | VAD | RMOD | | | | | | | | | | | | + * `----------------------+------+------+------+------+------| |------+------+------+------+------+----------------------' + * | | | | | | | | | | | | + * | | | | | | | | | | | | + * `----------------------------------' `----------------------------------' + */ + [_ADJUST] = LAYOUT( + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, _______, + _______, RGB_TOG, RGB_SAI, RGB_HUI, RGB_VAI, RGB_MOD, _______, _______, _______, KC_F11, KC_F12, _______, + _______, _______, RGB_SAD, RGB_HUD, RGB_VAD, RGB_RMOD,_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), +// /* +// * Layer template +// * +// * ,-------------------------------------------. ,-------------------------------------------. +// * | | | | | | | | | | | | | | +// * |--------+------+------+------+------+------| |------+------+------+------+------+--------| +// * | | | | | | | | | | | | | | +// * |--------+------+------+------+------+------+-------------. ,-------------+------+------+------+------+------+--------| +// * | | | | | | | | | | | | | | | | | | +// * `----------------------+------+------+------+------+------| |------+------+------+------+------+----------------------' +// * | | | | | | | | | | | | +// * | | | | | | | | | | | | +// * `----------------------------------' `----------------------------------' +// */ +// [_LAYERINDEX] = LAYOUT( +// _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, +// _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, +// _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, +// _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +// ), +}; + +layer_state_t layer_state_set_user(layer_state_t state) { + return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); +} + +#ifdef OLED_DRIVER_ENABLE +oled_rotation_t oled_init_user(oled_rotation_t rotation) { + return OLED_ROTATION_180; +} + +static void render_kyria_logo(void) { + static const char PROGMEM kyria_logo[] = { + 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, + 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, + 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, + 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, + 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, + 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, + 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, + 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 + }; + oled_write_raw_P(kyria_logo, sizeof(kyria_logo)); +} + +static void render_qmk_logo(void) { + static const char PROGMEM qmk_logo[] = { + 0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f,0x90,0x91,0x92,0x93,0x94, + 0xa0,0xa1,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7,0xa8,0xa9,0xaa,0xab,0xac,0xad,0xae,0xaf,0xb0,0xb1,0xb2,0xb3,0xb4, + 0xc0,0xc1,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,0xca,0xcb,0xcc,0xcd,0xce,0xcf,0xd0,0xd1,0xd2,0xd3,0xd4,0}; + + oled_write_P(qmk_logo, false); +} + +static void render_status(void) { + // QMK Logo and version information + render_qmk_logo(); + oled_write_P(PSTR("Kyria rev1.0\n\n"), false); + + // Host Keyboard Layer Status + oled_write_P(PSTR("Layer: "), false); + switch (get_highest_layer(layer_state)) { + case _QWERTY: + oled_write_P(PSTR("Default\n"), false); + break; + case _LOWER: + oled_write_P(PSTR("Lower\n"), false); + break; + case _RAISE: + oled_write_P(PSTR("Raise\n"), false); + break; + case _ADJUST: + oled_write_P(PSTR("Adjust\n"), false); + break; + default: + oled_write_P(PSTR("Undefined\n"), false); + } + + // Host Keyboard LED Status + uint8_t led_usb_state = host_keyboard_leds(); + oled_write_P(IS_LED_ON(led_usb_state, USB_LED_NUM_LOCK) ? PSTR("NUMLCK ") : PSTR(" "), false); + oled_write_P(IS_LED_ON(led_usb_state, USB_LED_CAPS_LOCK) ? PSTR("CAPLCK ") : PSTR(" "), false); + oled_write_P(IS_LED_ON(led_usb_state, USB_LED_SCROLL_LOCK) ? PSTR("SCRLCK ") : PSTR(" "), false); +} + +void oled_task_user(void) { + if (is_keyboard_master()) { + render_status(); // Renders the current keyboard state (layer, lock, caps, scroll, etc) + } else { + render_kyria_logo(); + } +} +#endif + +#ifdef ENCODER_ENABLE +void encoder_update_user(uint8_t index, bool clockwise) { + if (index == 0) { + // Volume control + if (clockwise) { + tap_code(KC_VOLU); + } else { + tap_code(KC_VOLD); + } + } + else if (index == 1) { + // Page up/Page down + if (clockwise) { + tap_code(KC_PGDN); + } else { + tap_code(KC_PGUP); + } + } +} +#endif diff --git a/keyboards/kyria/keymaps/default/rules.mk b/keyboards/kyria/keymaps/default/rules.mk new file mode 100644 index 000000000..213c50a80 --- /dev/null +++ b/keyboards/kyria/keymaps/default/rules.mk @@ -0,0 +1,3 @@ +OLED_DRIVER_ENABLE = yes # Enables the use of OLED displays +ENCODER_ENABLE = yes # ENables the use of one or more encoders +RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow
\ No newline at end of file diff --git a/keyboards/kyria/keymaps/drashna/config.h b/keyboards/kyria/keymaps/drashna/config.h new file mode 100644 index 000000000..83d6283f5 --- /dev/null +++ b/keyboards/kyria/keymaps/drashna/config.h @@ -0,0 +1,38 @@ +/* Copyright 2019 Thomas Baart <thomas@splitkb.com> + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#pragma once + +#define EE_HANDS + +#ifdef OLED_DRIVER_ENABLE +# define OLED_DISPLAY_128X64 +# define OLED_FONT_H "font_gmk_bad.h" +# define OLED_DISABLE_TIMEOUT +# define OLED_SCROLL_TIMEOUT_RIGHT 60000 +#endif + +#ifdef RGBLIGHT_ENABLE +# define RGBLIGHT_SLEEP +# define RGBLIGHT_LIMIT_VAL 200 +# define RGBLIGHT_HUE_STEP 8 +# define RGBLIGHT_SAT_STEP 8 +# define RGBLIGHT_VAL_STEP 8 +#endif + +// If you are using an Elite C rev3 on the slave side, uncomment the lines below: +#define SPLIT_USB_DETECT +#define SPLIT_USB_TIMEOUT 1000 diff --git a/keyboards/kyria/keymaps/drashna/keymap.c b/keyboards/kyria/keymaps/drashna/keymap.c new file mode 100644 index 000000000..bdb00e596 --- /dev/null +++ b/keyboards/kyria/keymaps/drashna/keymap.c @@ -0,0 +1,372 @@ +#include "drashna.h" + +uint8_t is_master; + +#ifdef OLED_DRIVER_ENABLE +# define KEYLOGGER_LENGTH 10 +static uint32_t oled_timer = 0; +static char keylog_str[KEYLOGGER_LENGTH + 1] = {"\n"}; +static uint16_t log_timer = 0; +// clang-format off +static const char PROGMEM code_to_name[0xFF] = { +// 0 1 2 3 4 5 6 7 8 9 A B c D E F + ' ', ' ', ' ', ' ', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', // 0x + 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '1', '2', // 1x + '3', '4', '5', '6', '7', '8', '9', '0', 20, 19, 27, 26, 22, '-', '=', '[', // 2x + ']','\\', '#', ';','\'', '`', ',', '.', '/', 128, ' ', ' ', ' ', ' ', ' ', ' ', // 3x + ' ', ' ', ' ', ' ', ' ', ' ', 'P', 'S', ' ', ' ', ' ', ' ', 16, ' ', ' ', ' ', // 4x + ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // 5x + ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // 6x + ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // 7x + ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // 8x + ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // 9x + ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // Ax + ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // Bx + ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // Cx + ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // Dx + 'C', 'S', 'A', 'C', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // Ex + ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ' // Fx +}; + +void add_keylog(uint16_t keycode); +#endif + +#ifndef UNICODE_ENABLE +# define UC(x) KC_NO +#endif + +/* + * The `LAYOUT_kyria_base` macro is a template to allow the use of identical + * modifiers for the default layouts (eg QWERTY, Colemak, Dvorak, etc), so + * that there is no need to set them up for each layout, and modify all of + * them if I want to change them. This helps to keep consistency and ease + * of use. K## is a placeholder to pass through the individual keycodes + */ + +// clang-format off +#define LAYOUT_kyria_base( \ + K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, \ + K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, \ + K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A \ + ) \ + LAYOUT_wrapper( \ + KC_ESC, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, KC_MINS, \ + LALT_T(KC_TAB), K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, RALT_T(KC_QUOT), \ + OS_LSFT, CTL_T(K21), K22, K23, K24, K25, KC_NO, KC_NO, KC_NO, KC_NO, K26, K27, K28, K29, RCTL_T(K2A), OS_RSFT, \ + KC_MUTE, OS_LALT, KC_GRV, KC_SPC, BK_LWER, DL_RAIS, KC_ENT, OS_RGUI, UC(0x03A8), UC(0x2E2E) \ + ) +/* Re-pass though to allow templates to be used */ +#define LAYOUT_kyria_base_wrapper(...) LAYOUT_kyria_base(__VA_ARGS__) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_QWERTY] = LAYOUT_kyria_base_wrapper( + _________________QWERTY_L1_________________, _________________QWERTY_R1_________________, + _________________QWERTY_L2_________________, _________________QWERTY_R2_________________, + _________________QWERTY_L3_________________, _________________QWERTY_R3_________________ + ), + + [_COLEMAK] = LAYOUT_kyria_base_wrapper( + _________________COLEMAK_L1________________, _________________COLEMAK_R1________________, + _________________COLEMAK_L2________________, _________________COLEMAK_R2________________, + _________________COLEMAK_L3________________, _________________COLEMAK_R3________________ + ), + + [_DVORAK] = LAYOUT_kyria_base_wrapper( + _________________DVORAK_L1_________________, _________________DVORAK_R1_________________, + _________________DVORAK_L2_________________, _________________DVORAK_R2_________________, + _________________DVORAK_L3_________________, _________________DVORAK_R3_________________ + ), + + [_WORKMAN] = LAYOUT_kyria_base_wrapper( + _________________WORKMAN_L1________________, _________________WORKMAN_R1________________, + _________________WORKMAN_L2________________, _________________WORKMAN_R2________________, + _________________WORKMAN_L3________________, _________________WORKMAN_R3________________ + ), + + [_NORMAN] = LAYOUT_kyria_base_wrapper( + _________________NORMAN_L1_________________, _________________NORMAN_L1_________________, + _________________NORMAN_L2_________________, _________________NORMAN_R2_________________, + _________________NORMAN_L3_________________, _________________NORMAN_R3_________________ + ), + + [_MALTRON] = LAYOUT_kyria_base_wrapper( + _________________MALTRON_L1________________, _________________MALTRON_R1________________, + _________________MALTRON_L2________________, _________________MALTRON_R2________________, + _________________MALTRON_L3________________, _________________MALTRON_R3________________ + ), + + [_EUCALYN] = LAYOUT_kyria_base_wrapper( + _________________EUCALYN_L1________________, _________________EUCALYN_R1________________, + _________________EUCALYN_L2________________, _________________EUCALYN_R2________________, + _________________EUCALYN_L3________________, _________________EUCALYN_R3________________ + ), + + [_CARPLAX] = LAYOUT_kyria_base_wrapper( + _____________CARPLAX_QFMLWY_L1_____________, _____________CARPLAX_QFMLWY_R1_____________, + _____________CARPLAX_QFMLWY_L2_____________, _____________CARPLAX_QFMLWY_R2_____________, + _____________CARPLAX_QFMLWY_L3_____________, _____________CARPLAX_QFMLWY_R3_____________ + ), + [_MODS] = LAYOUT_wrapper( + _______, ___________________BLANK___________________, ___________________BLANK___________________, _______, + _______, ___________________BLANK___________________, ___________________BLANK___________________, _______, + KC_LSFT, ___________________BLANK___________________, _______, _______, _______, _______, ___________________BLANK___________________, KC_RSFT, + _______, _______, KC_LALT, _______, _______, _______, _______, KC_RGUI, _______, _______ + ), + [_LOWER] = LAYOUT_wrapper( + KC_F12, _________________LOWER_L1__________________, _________________LOWER_R1__________________, KC_F11, + _______, _________________LOWER_L2__________________, _________________LOWER_R2__________________, KC_PIPE, + _______, _________________LOWER_L3__________________, _______, _______, _______, _______, _________________LOWER_R3__________________, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), + [_RAISE] = LAYOUT_wrapper( + KC_F12, _________________RAISE_L1__________________, _________________RAISE_R1__________________, KC_F11, + _______, _________________RAISE_L2__________________, _________________RAISE_R2__________________, KC_BSLS, + _______, _________________RAISE_L3__________________, _______, _______, _______, _______, _________________RAISE_R3__________________, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), + [_ADJUST] = LAYOUT_wrapper( + KC_MAKE, _________________ADJUST_L1_________________, _________________ADJUST_R1_________________, KC_RESET, + VRSN, _________________ADJUST_L2_________________, _________________ADJUST_R2_________________, EEP_RST, + _______, _________________ADJUST_L3_________________, HPT_TOG, HPT_FBK, MG_NKRO, UC_MOD, _________________ADJUST_R3_________________, TG_MODS, + _______, _______, _______, KC_NUKE, _______, _______, _______, _______, _______, _______ + ), +// [_LAYERINDEX] = LAYOUT_wrapper( +// _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, +// _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, +// _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, +// _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +// ), +}; +// clang-format on + +bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { + if (record->event.pressed) { +#ifdef OLED_DRIVER_ENABLE + oled_timer = timer_read32(); + add_keylog(keycode); +#endif +#ifndef SPLIT_KEYBOARD + if (keycode == RESET && !is_master) { + return false; + } +#endif + } + return true; +} +void matrix_init_keymap(void) { is_master = (uint8_t)is_keyboard_master(); } + +#ifdef OLED_DRIVER_ENABLE +oled_rotation_t oled_init_user(oled_rotation_t rotation) { return OLED_ROTATION_180; } + +void add_keylog(uint16_t keycode) { + if ((keycode >= QK_MOD_TAP && keycode <= QK_MOD_TAP_MAX) || (keycode >= QK_LAYER_TAP && keycode <= QK_LAYER_TAP_MAX) || (keycode >= QK_MODS && keycode <= QK_MODS_MAX)) { + keycode = keycode & 0xFF; + } else if (keycode > 0xFF) { + keycode = 0; + } + + for (uint8_t i = (KEYLOGGER_LENGTH - 1); i > 0; --i) { + keylog_str[i] = keylog_str[i - 1]; + } + + if (keycode < (sizeof(code_to_name) / sizeof(char))) { + keylog_str[0] = pgm_read_byte(&code_to_name[keycode]); + } + + log_timer = timer_read(); +} + +void update_log(void) { + if (timer_elapsed(log_timer) > 750) { + // add_keylog(0); + } +} + +void render_keylogger_status(void) { + oled_write_P(PSTR("Keylogger: "), false); + oled_write(keylog_str, false); +} + +void render_default_layer_state(void) { + oled_write_P(PSTR("Layout: "), false); + switch (get_highest_layer(default_layer_state)) { + case _QWERTY: + oled_write_ln_P(PSTR("Qwerty "), false); + break; + case _COLEMAK: + oled_write_ln_P(PSTR("Colemak"), false); + break; + case _DVORAK: + oled_write_ln_P(PSTR("Dvorak"), false); + break; + case _WORKMAN: + oled_write_ln_P(PSTR("Workman"), false); + break; + case _NORMAN: + oled_write_ln_P(PSTR("Norman"), false); + break; + case _MALTRON: + oled_write_ln_P(PSTR("Maltron"), false); + break; + case _EUCALYN: + oled_write_ln_P(PSTR("Eucalyn"), false); + break; + case _CARPLAX: + oled_write_ln_P(PSTR("Carplax"), false); + break; + } +} + +void render_layer_state(void) { + oled_write_ln_P(PSTR("Layer:"), false); + oled_write_P(PSTR(" "), false); + oled_write_P(PSTR("Lower"), layer_state_is(_LOWER)); + oled_write_P(PSTR(" "), false); + oled_write_P(PSTR("Raise"), layer_state_is(_RAISE)); + oled_write_P(PSTR(" "), false); + oled_write_ln_P(PSTR("Mods"), layer_state_is(_MODS)); +} + +void render_keylock_status(uint8_t led_usb_state) { + oled_write_P(PSTR("Lock: "), false); + oled_write_P(PSTR("NUM"), led_usb_state & (1 << USB_LED_NUM_LOCK)); + oled_write_P(PSTR(" "), false); + oled_write_P(PSTR("CAPS"), led_usb_state & (1 << USB_LED_CAPS_LOCK)); + oled_write_P(PSTR(" "), false); + oled_write_ln_P(PSTR("SCL"), led_usb_state & (1 << USB_LED_SCROLL_LOCK)); +} + +void render_mod_status(uint8_t modifiers) { + oled_write_P(PSTR("Mods: "), false); + oled_write_P(PSTR("Sft"), (modifiers & MOD_MASK_SHIFT)); + oled_write_P(PSTR(" "), false); + oled_write_P(PSTR("Ctl"), (modifiers & MOD_MASK_CTRL)); + oled_write_P(PSTR(" "), false); + oled_write_P(PSTR("Alt"), (modifiers & MOD_MASK_ALT)); + oled_write_P(PSTR(" "), false); + oled_write_P(PSTR("GUI"), (modifiers & MOD_MASK_GUI)); +} + +void render_bootmagic_status(void) { + /* Show Ctrl-Gui Swap options */ + static const char PROGMEM logo[][2][3] = { + {{0x97, 0x98, 0}, {0xb7, 0xb8, 0}}, + {{0x95, 0x96, 0}, {0xb5, 0xb6, 0}}, + }; + oled_write_P(PSTR("Boot "), false); + oled_write_P(logo[0][0], !keymap_config.swap_lctl_lgui); + oled_write_P(logo[1][0], keymap_config.swap_lctl_lgui); + oled_write_P(PSTR(" "), false); + oled_write_P(PSTR("NKRO"), keymap_config.nkro); + oled_write_P(PSTR(" "), false); + oled_write_ln_P(PSTR("GUI"), !keymap_config.no_gui); + oled_write_P(PSTR("Magic "), false); + oled_write_P(logo[0][1], !keymap_config.swap_lctl_lgui); + oled_write_P(logo[1][1], keymap_config.swap_lctl_lgui); + oled_write_P(PSTR(" "), false); + oled_write_P(PSTR("GRV"), keymap_config.swap_grave_esc); + oled_write_P(PSTR(" "), false); + oled_write_ln_P(PSTR("CAPS"), keymap_config.swap_control_capslock); +} + +void render_user_status(void) { + oled_write_P(PSTR("USER: "), false); + oled_write_P(PSTR("Anim"), userspace_config.rgb_matrix_idle_anim); + oled_write_P(PSTR(" "), false); + oled_write_P(PSTR("Layr"), userspace_config.rgb_layer_change); + oled_write_P(PSTR(" "), false); + oled_write_ln_P(PSTR("Nuke"), userspace_config.nuke_switch); +} + +// clang-format off +void render_logo(void) { + static const char PROGMEM qmk_logo[] = { + 0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f,0x90,0x91,0x92,0x93,0x94, + 0xa0,0xa1,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7,0xa8,0xa9,0xaa,0xab,0xac,0xad,0xae,0xaf,0xb0,0xb1,0xb2,0xb3,0xb4, + 0xc0,0xc1,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,0xca,0xcb,0xcc,0xcd,0xce,0xcf,0xd0,0xd1,0xd2,0xd3,0xd4,0}; + + oled_write_P(qmk_logo, false); +} + +# ifndef SPLIT_TRANSPORT_MIRROR +void render_kyria_logo(void) { + static const char PROGMEM kyria_logo[] = { + 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, + 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, + 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, + 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, + 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, + 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, + 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, + 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 + }; + oled_write_raw_P(kyria_logo, sizeof(kyria_logo)); +} +# endif +// clang-format on + +void render_status_main(void) { + /* Show Keyboard Layout */ + render_default_layer_state(); + render_keylock_status(host_keyboard_leds()); + render_bootmagic_status(); + render_user_status(); + + render_keylogger_status(); +} + +void render_status_secondary(void) { + /* Show Keyboard Layout */ + render_logo(); + render_default_layer_state(); + render_layer_state(); + render_mod_status(get_mods() | get_oneshot_mods()); + + render_keylogger_status(); +} + +void oled_task_user(void) { + if (timer_elapsed32(oled_timer) > 30000) { + oled_off(); + return; + } +# ifndef SPLIT_KEYBOARD + else { + oled_on(); + } +# endif + + update_log(); + if (is_master) { + render_status_main(); // Renders the current keyboard state (layer, lock, caps, scroll, etc) + } else { +# ifdef SPLIT_TRANSPORT_MIRROR + render_status_secondary(); +# else + render_kyria_logo(); +# endif + } +} + +#endif + +#ifdef ENCODER_ENABLE +void encoder_update_user(uint8_t index, bool clockwise) { + if (index == 0) { + // Volume control + if (clockwise) { + tap_code(KC_VOLU); + } else { + tap_code(KC_VOLD); + } + } else if (index == 1) { + // Page up/Page down + if (clockwise) { + tap_code(KC_PGDN); + } else { + tap_code(KC_PGUP); + } + } +} +#endif diff --git a/keyboards/kyria/keymaps/drashna/rules.mk b/keyboards/kyria/keymaps/drashna/rules.mk new file mode 100644 index 000000000..c1a37f5c5 --- /dev/null +++ b/keyboards/kyria/keymaps/drashna/rules.mk @@ -0,0 +1,22 @@ +OLED_DRIVER_ENABLE = yes # Enables the use of OLED displays +ENCODER_ENABLE = yes # ENables the use of one or more encoders +RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow +RGBLIGHT_STARTUP_ANIMATION = yes + +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration +MOUSEKEY_ENABLE = no # Mouse keys +EXTRAKEY_ENABLE = yes # Audio control and System control +CONSOLE_ENABLE = no # Console for debug +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = no # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +MIDI_ENABLE = no # MIDI support +UNICODE_ENABLE = yes # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs + +BOOTLOADER = atmel-dfu + +SPLIT_TRANSPORT = mirror diff --git a/keyboards/kyria/keymaps/thomasbaart/config.h b/keyboards/kyria/keymaps/thomasbaart/config.h new file mode 100644 index 000000000..e878663bf --- /dev/null +++ b/keyboards/kyria/keymaps/thomasbaart/config.h @@ -0,0 +1,47 @@ +/* Copyright 2019 Thomas Baart <thomas@splitkb.com> + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#pragma once + +#ifdef OLED_DRIVER_ENABLE + #define OLED_DISPLAY_128X64 +#endif + +#ifdef RGBLIGHT_ENABLE + #define RGBLIGHT_ANIMATIONS + #define RGBLIGHT_HUE_STEP 8 + #define RGBLIGHT_SAT_STEP 8 + #define RGBLIGHT_VAL_STEP 8 + #define RGBLIGHT_SLEEP +#endif + +// EC11K encoders have a different resolution than other EC11 encoders. +// When using the default resolution of 4, if you notice your encoder skipping +// every other tick, lower the resolution to 2. +#define ENCODER_RESOLUTION 2 + +// The Leader key allows to flexibly assign macros to key sequences. +#define LEADER_PER_KEY_TIMING +#define LEADER_TIMEOUT 350 + +#define TAPPING_TERM 200 + +// Allows to use either side as the master. Look at the documentation for info: +// https://docs.qmk.fm/#/config_options?id=setting-handedness +#define EE_HANDS + +// Allows media codes to properly register in macros and rotary encoder code +#define TAP_CODE_DELAY 10
\ No newline at end of file diff --git a/keyboards/kyria/keymaps/thomasbaart/keymap.c b/keyboards/kyria/keymaps/thomasbaart/keymap.c new file mode 100644 index 000000000..ea6ce0a74 --- /dev/null +++ b/keyboards/kyria/keymaps/thomasbaart/keymap.c @@ -0,0 +1,333 @@ +/* Copyright 2019 Thomas Baart <thomas@splitkb.com> + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ +#include QMK_KEYBOARD_H + +uint16_t copy_paste_timer; + +enum layers { + QWERTY = 0, + LOWER, + RAISE, + NAV, + ADJUST +}; + +enum custom_keycodes { + KC_CCCV = SAFE_RANGE +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* + * Base Layer: QWERTY + * + * ,-------------------------------------------. ,-------------------------------------------. + * | ESC | Q | W | E | R | T | | Y | U | I | O | P | | \ | + * |--------+------+------+------+------+------| |------+------+------+------+------+--------| + * | LSFT | A | S | D | F | G | | H | J | K | L | ; : | ' " | + * |--------+------+------+------+------+------+-------------. ,-------------+------+------+------+------+------+--------| + * | LCTL | Z | X | C | V | B | CCCV | | | Del |Leader| N | M | , < | . > | / ? | - _ | + * `----------------------+------+------+------+------+ | |------+------+------+------+------+----------------------' + * | GUI | Alt | | Space| Enter| | Bspc | Space| | Tab | AltGr| + * | | | Lower| Shift| Alt | | | Nav | Raise| | | + * `----------------------------------' `----------------------------------' + */ + [QWERTY] = LAYOUT( + KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_PIPE, + KC_LSFT, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_LCTL, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_CCCV, XXXXXXX, KC_DEL, KC_LEAD, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_MINS, + KC_LGUI, KC_LALT, MO(LOWER), MT(MOD_LSFT, KC_SPC), MT(MOD_LALT, KC_ENT), KC_BSPC, LT(NAV, KC_SPC), MO(RAISE), KC_TAB, KC_RALT + ), +/* + * Lower Layer: Numpad, Media + * + * ,-------------------------------------------. ,-------------------------------------------. + * | | | | VolUp| | | | / ? | 7 & | 8 * | 9 ( | - _ | | + * |--------+------+------+------+------+------| |------+------+------+------+------+--------| + * | | | Prev | Play | Next | | | * | 4 $ | 5 % | 6 ^ | , < | + | + * |--------+------+------+------+------+------+-------------. ,-------------+------+------+------+------+------+--------| + * | | | | VolDn| Mute | | | | | | | 0 ) | 1 ! | 2 @ | 3 # | = + | | + * `----------------------+------+------+------+------+------| |------+------+------+------+------+----------------------' + * | | | | | | | | | | | | + * | | | Lower| | | | | Nav | Raise| | | + * `----------------------------------' `----------------------------------' + */ + [LOWER] = LAYOUT( + _______, _______, _______, KC_VOLU, _______, _______, KC_SLSH, KC_7, KC_8, KC_9, KC_MINS, _______, + _______, _______, KC_MPRV, KC_MPLY, KC_MNXT, _______, KC_ASTR, KC_4, KC_5, KC_6, KC_COMM, KC_PLUS, + _______, _______, _______, KC_VOLD, KC_MUTE, _______, _______, _______, _______, _______, KC_0, KC_1, KC_2, KC_3, KC_EQL, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), +/* + * Raise Layer: Symbols + * + * ,-------------------------------------------. ,-------------------------------------------. + * | | ! | @ | { | } | | | | | _ | € | | | \ | + * |--------+------+------+------+------+------| |------+------+------+------+------+--------| + * | | # | $ | ( | ) | ` | | + | - | / | * | % | ' " | + * |--------+------+------+------+------+------+-------------. ,-------------+------+------+------+------+------+--------| + * | | % | ^ | [ | ] | ~ | | | | | | & | = | , | . | / ? | - _ | + * `----------------------+------+------+------+------+------| |------+------+------+------+------+----------------------' + * | | | | | | | | | | | | + * | | | Lower| | | | | Nav | Raise| | | + * `----------------------------------' `----------------------------------' + */ + [RAISE] = LAYOUT( + _______, KC_EXLM, KC_AT, KC_LCBR, KC_RCBR, KC_PIPE, _______, KC_UNDS, ALGR(KC_5),_______,_______,KC_BSLS, + _______, KC_HASH, KC_DLR, KC_LPRN, KC_RPRN, KC_GRV, KC_PLUS, KC_MINS, KC_SLSH, KC_ASTR, KC_PERC, KC_QUOT, + _______, KC_PERC, KC_CIRC, KC_LBRC, KC_RBRC, KC_TILD, _______, _______, _______, _______, KC_AMPR, KC_EQL, KC_COMM, KC_DOT, KC_SLSH, KC_MINS, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), +/* + * Navigation Layer + * + * ,-------------------------------------------. ,-------------------------------------------. + * | | | | | | | | PgUp | Home | Up | End | | ScrlLk | + * |--------+------+------+------+------+------| |------+------+------+------+------+--------| + * | | | | | | | | PgDn | Left | Down | Right| | CapsLk | + * |--------+------+------+------+------+------+-------------. ,-------------+------+------+------+------+------+--------| + * | | | | | | | | | | | | | | | | | | + * `----------------------+------+------+------+------+------| |------+------+------+------+------+----------------------' + * | | | | | | | | | | | | + * | | | Lower| | | | | Nav | Raise| | | + * `----------------------------------' `----------------------------------' + */ + [NAV] = LAYOUT( + _______, _______, _______, _______, _______, _______, KC_PGUP, KC_HOME, KC_UP, KC_END, _______, KC_SLCK, + _______, _______, _______, _______, _______, _______, KC_PGDN, KC_LEFT, KC_DOWN, KC_RGHT, _______, KC_CAPS, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), +/* + * Adjust Layer + * + * ,-------------------------------------------. ,-------------------------------------------. + * | | | | | | | | | F7 | F8 | F9 | F10 | | + * |--------+------+------+------+------+------| |------+------+------+------+------+--------| + * | | | SAI | HUI | VAI | | | | F4 | F5 | F6 | F11 | | + * |--------+------+------+------+------+------+-------------. ,-------------+------+------+------+------+------+--------| + * | | | SAD | HUD | VAD | | | | | | | | F1 | F2 | F3 | F12 | | + * `----------------------+------+------+------+------+------| |------+------+------+------+------+----------------------' + * | | | | | | | | | | | | + * | | | | | | | | | | | | + * `----------------------------------' `----------------------------------' + */ + [ADJUST] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, KC_F7, KC_F8, KC_F9, KC_F10, _______, + _______, _______, RGB_SAI, RGB_HUI, RGB_VAI, _______, _______, KC_F4, KC_F5, KC_F6, KC_F11, _______, + _______, _______, RGB_SAD, RGB_HUD, RGB_VAD, _______, _______, _______, _______, _______, _______, KC_F1, KC_F2, KC_F3, KC_F12, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), +// /* +// * Layer template +// * +// * ,-------------------------------------------. ,-------------------------------------------. +// * | | | | | | | | | | | | | | +// * |--------+------+------+------+------+------| |------+------+------+------+------+--------| +// * | | | | | | | | | | | | | | +// * |--------+------+------+------+------+------+-------------. ,-------------+------+------+------+------+------+--------| +// * | | | | | | | | | | | | | | | | | | +// * `----------------------+------+------+------+------+------| |------+------+------+------+------+----------------------' +// * | | | | | | | | | | | | +// * | | | | | | | | | | | | +// * `----------------------------------' `----------------------------------' +// */ +// [_LAYERINDEX] = LAYOUT( +// _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, +// _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, +// _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, +// _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +// ), +}; + +layer_state_t layer_state_set_user(layer_state_t state) { + return update_tri_layer_state(state, LOWER, RAISE, ADJUST); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case KC_CCCV: // One key copy/paste + if (record->event.pressed) { + copy_paste_timer = timer_read(); + } else { + if (timer_elapsed(copy_paste_timer) > TAPPING_TERM) { // Hold, copy + tap_code16(LCTL(KC_C)); + } else { // Tap, paste + tap_code16(LCTL(KC_V)); + } + } + break; + } + return true; +} + +LEADER_EXTERNS(); + +void matrix_scan_user(void) { + LEADER_DICTIONARY() { + leading = false; + leader_end(); + + SEQ_ONE_KEY(KC_C) { // Inline Code + SEND_STRING("`` " SS_TAP(X_LEFT) SS_TAP(X_LEFT)); + } + SEQ_ONE_KEY(KC_P) { // Invoke Password Manager + SEND_STRING(SS_LCTRL(SS_LALT("\\"))); + } + SEQ_ONE_KEY(KC_S) { // Windows screenshot + SEND_STRING(SS_LGUI("\nS")); + } + SEQ_TWO_KEYS(KC_F, KC_P) { // Fusion Projection prefix + SEND_STRING("[Projection] "); + } + SEQ_TWO_KEYS(KC_E, KC_S) { // Email splitkb + SEND_STRING("thomas@splitkb.com"); + } + SEQ_TWO_KEYS(KC_E, KC_P) { // Email personal + SEND_STRING("mail@thomasbaart.nl"); + } + SEQ_TWO_KEYS(KC_S, KC_D) { // Splitkb documentation + SEND_STRING("https://docs.splitkb.com/"); + } + SEQ_TWO_KEYS(KC_S, KC_V) { // Splitkb VAT number + SEND_STRING("NL210593349B01"); + } + SEQ_THREE_KEYS(KC_S, KC_D, KC_K) { // Splitkb Kyria build log + SEND_STRING("https://docs.splitkb.com/docs/kyria-build-log/"); + } + SEQ_TWO_KEYS(KC_B, KC_C) { // Discord bongocat + SEND_STRING(":bongocat:\n"); + } + SEQ_TWO_KEYS(KC_C, KC_B) { // Discord code block + SEND_STRING("```c" SS_LSFT("\n\n") "``` " SS_TAP(X_UP)); + } + } +} + +#ifdef OLED_DRIVER_ENABLE +oled_rotation_t oled_init_user(oled_rotation_t rotation) { + return OLED_ROTATION_180; +} + +static void render_kyria_logo(void) { + static const char PROGMEM kyria_logo[] = { + 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, + 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, + 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, + 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, + 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, + 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, + 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, + 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 + }; + oled_write_raw_P(kyria_logo, sizeof(kyria_logo)); +} + +static void render_qmk_logo(void) { + static const char PROGMEM qmk_logo[] = { + 0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f,0x90,0x91,0x92,0x93,0x94, + 0xa0,0xa1,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7,0xa8,0xa9,0xaa,0xab,0xac,0xad,0xae,0xaf,0xb0,0xb1,0xb2,0xb3,0xb4, + 0xc0,0xc1,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,0xca,0xcb,0xcc,0xcd,0xce,0xcf,0xd0,0xd1,0xd2,0xd3,0xd4,0}; + + oled_write_P(qmk_logo, false); +} + +static void render_status(void) { + // QMK Logo and version information + render_qmk_logo(); + oled_write_P(PSTR(" Kyria rev1.0\n\n"), false); + + // Host Keyboard Layer Status + oled_write_P(PSTR("Layer: "), false); + switch (get_highest_layer(layer_state)) { + case QWERTY: + oled_write_P(PSTR("Default\n"), false); + break; + case LOWER: + oled_write_P(PSTR("Lower\n"), false); + break; + case RAISE: + oled_write_P(PSTR("Raise\n"), false); + break; + case NAV: + oled_write_P(PSTR("Navigation\n"), false); + break; + case ADJUST: + oled_write_P(PSTR("Adjust\n"), false); + break; + default: + oled_write_P(PSTR("Undefined\n"), false); + } + + // Host Keyboard LED Status + uint8_t led_usb_state = host_keyboard_leds(); + oled_write_P(IS_LED_ON(led_usb_state, USB_LED_NUM_LOCK) ? PSTR("NUMLCK ") : PSTR(" "), false); + oled_write_P(IS_LED_ON(led_usb_state, USB_LED_CAPS_LOCK) ? PSTR("CAPLCK ") : PSTR(" "), false); + oled_write_P(IS_LED_ON(led_usb_state, USB_LED_SCROLL_LOCK) ? PSTR("SCRLCK ") : PSTR(" "), false); +} + +void oled_task_user(void) { + if (is_keyboard_master()) { + render_status(); // Renders the current keyboard state (layer, lock, caps, scroll, etc) + } else { + render_kyria_logo(); + } +} +#endif + +#ifdef ENCODER_ENABLE +void encoder_update_user(uint8_t index, bool clockwise) { + if (index == 0) { + switch (biton32(layer_state)) { + case QWERTY: + // Move whole words. Hold shift to select while moving. + if (clockwise) { + tap_code16(C(KC_RGHT)); + } else { + tap_code16(C(KC_LEFT)); + } + break; + default: + // History scrubbing. For Adobe products, hold shift while moving + // backward to go forward instead. + if (clockwise) { + tap_code16(C(KC_Z)); + } else { + tap_code16(C(KC_Y)); + } + break; + } + } else if (index == 1) { + switch (biton32(layer_state)) { + case QWERTY: + // Scrolling with PageUp and PgDn. + if (clockwise) { + tap_code(KC_PGDN); + } else { + tap_code(KC_PGUP); + } + break; + default: + // Volume control. + if (clockwise) { + tap_code(KC_VOLU); + } else { + tap_code(KC_VOLD); + } + break; + } + } +} +#endif diff --git a/keyboards/kyria/keymaps/thomasbaart/rules.mk b/keyboards/kyria/keymaps/thomasbaart/rules.mk new file mode 100644 index 000000000..9b8e29419 --- /dev/null +++ b/keyboards/kyria/keymaps/thomasbaart/rules.mk @@ -0,0 +1,5 @@ +OLED_DRIVER_ENABLE = yes # Enables the use of OLED displays +ENCODER_ENABLE = yes # Enables the use of one or more encoders +RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow +LEADER_ENABLE = yes # Enable the Leader Key feature +MOUSEKEY_ENABLE = no |