diff options
author | HorrorTroll <sonicvipduc@gmail.com> | 2022-10-27 00:59:30 +0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-26 18:59:30 +0100 |
commit | 9dec43a0f2ebfb0af1aea7e43b651cc67fd39a32 (patch) | |
tree | 7ab369fc9dda3139c49c6d1483a043aba85be67b /keyboards/doio/kb16/keymaps/via | |
parent | cd8099539b289c2d990d30be33d47bdb535ee911 (diff) |
Added new keyboard DOIO KB16 (Rev 2) (#18699)
Diffstat (limited to 'keyboards/doio/kb16/keymaps/via')
-rw-r--r-- | keyboards/doio/kb16/keymaps/via/keymap.c | 172 | ||||
-rw-r--r-- | keyboards/doio/kb16/keymaps/via/rules.mk | 1 |
2 files changed, 0 insertions, 173 deletions
diff --git a/keyboards/doio/kb16/keymaps/via/keymap.c b/keyboards/doio/kb16/keymaps/via/keymap.c deleted file mode 100644 index 4f01846eae..0000000000 --- a/keyboards/doio/kb16/keymaps/via/keymap.c +++ /dev/null @@ -1,172 +0,0 @@ -/* Copyright 2022 DOIO - * Copyright 2022 HorrorTroll <https://github.com/HorrorTroll> - * - * 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 - -// OLED animation -#include "lib/layer_status/layer_status.h" - -// Each layer gets a name for readability, which is then used in the keymap matrix below. -// The underscores don't mean anything - you can have a layer called STUFF or any other name. -// Layer names don't all need to be of the same length, obviously, and you can also skip them -// entirely and just use numbers. - -enum layer_names { - _BASE, - _FN, - _FN1, - _FN2 -}; - -// enum layer_keycodes { }; - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - -/* - ┌───┬───┬───┬───┐ ┌───┐ ┌───┐ - │ 1 │ 2 │ 3 │ 4 │ │Ply│ │TO1│ - ├───┼───┼───┼───┤ └───┘ └───┘ - │ 5 │ 6 │ 7 │ 8 │ - ├───┼───┼───┼───┤ - │ 9 │ 0 │ ↑ │Ent│ ┌───┐ - ├───┼───┼───┼───┤ │Mut│ - │Fn2│ ← │ ↓ │ → │ └───┘ - └───┴───┴───┴───┘ - ┌───┬───┬───┬───┐ ┌───┐ ┌───┐ - │ ! │ @ │ # │ $ │ │ │ │ │ - ├───┼───┼───┼───┤ └───┘ └───┘ - │ % │ ^ │ & │ * │ - ├───┼───┼───┼───┤ - │ ( │ ) │ │ │ ┌───┐ - ├───┼───┼───┼───┤ │ │ - │ │ │ │ │ └───┘ - └───┴───┴───┴───┘ -*/ - /* Row: 0 1 2 3 4 5 6 */ - [_BASE] = LAYOUT( - KC_1, KC_2, KC_3, KC_4, KC_MPRV, KC_MPLY, KC_MNXT, - KC_5, KC_6, KC_7, KC_8, KC_PGDN, TO(_FN), KC_PGUP, - KC_9, KC_0, KC_UP, KC_ENT, KC_VOLD, KC_MUTE, KC_VOLU, - MO(_FN2), KC_LEFT, KC_DOWN, KC_RIGHT - ), - -/* - ┌───┬───┬───┬───┐ ┌───┐ ┌───┐ - │ │ │ │ │ │ │ │ │ - ├───┼───┼───┼───┤ └───┘ └───┘ - │ │ │ │ │ - ├───┼───┼───┼───┤ - │ │ │ │ │ ┌───┐ - ├───┼───┼───┼───┤ │ │ - │ │ │ │ │ └───┘ - └───┴───┴───┴───┘ -*/ - /* Row: 0 1 2 3 4 5 6 */ - [_FN] = LAYOUT( - _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, TO(_FN1), _______, - _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______ - ), - -/* - ┌───┬───┬───┬───┐ ┌───┐ ┌───┐ - │ │ │ │ │ │ │ │ │ - ├───┼───┼───┼───┤ └───┘ └───┘ - │ │ │ │ │ - ├───┼───┼───┼───┤ - │ │ │ │ │ ┌───┐ - ├───┼───┼───┼───┤ │ │ - │ │ │ │ │ └───┘ - └───┴───┴───┴───┘ -*/ - /* Row: 0 1 2 3 4 5 6 */ - [_FN1] = LAYOUT( - _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, TO(_FN2), _______, - _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______ - ), - -/* - ┌───┬───┬───┬───┐ ┌───┐ ┌───┐ - │Spi│Spd│ │ │ │ │ │TO0│ - ├───┼───┼───┼───┤ └───┘ └───┘ - │Sai│Sad│ │ │ - ├───┼───┼───┼───┤ - │Tog│Mod│Hui│ │ ┌───┐ - ├───┼───┼───┼───┤ │ │ - │ │Vai│Hud│Vad│ └───┘ - └───┴───┴───┴───┘ -*/ - /* Row: 0 1 2 3 4 5 6 */ - [_FN2] = LAYOUT( - RGB_SPI, RGB_SPD, _______, QK_BOOT, _______, _______, _______, - RGB_SAI, RGB_SAD, _______, _______, _______, TO(_BASE), _______, - RGB_TOG, RGB_MOD, RGB_HUI, _______, _______, _______, _______, - _______, RGB_VAI, RGB_HUD, RGB_VAD - ), -}; - -#ifdef OLED_ENABLE - bool oled_task_user(void) { - render_layer_status(); - - return true; - } -#endif - -#ifdef ENCODER_ENABLE - -#define ENCODERS 3 -static uint8_t encoder_state[ENCODERS] = {0}; -static keypos_t encoder_cw[ENCODERS] = {{ 5, 0 }, { 5, 1 }, { 5, 2 }}; -static keypos_t encoder_ccw[ENCODERS] = {{ 6, 0 }, { 6, 1 }, { 6, 2 }}; - -void encoder_action_unregister(void) { - for (int index = 0; index < ENCODERS; ++index) { - if (encoder_state[index]) { - keyevent_t encoder_event = (keyevent_t) { - .key = encoder_state[index] >> 1 ? encoder_cw[index] : encoder_ccw[index], - .pressed = false, - .time = (timer_read() | 1) - }; - encoder_state[index] = 0; - action_exec(encoder_event); - } - } -} - -void encoder_action_register(uint8_t index, bool clockwise) { - keyevent_t encoder_event = (keyevent_t) { - .key = clockwise ? encoder_cw[index] : encoder_ccw[index], - .pressed = true, - .time = (timer_read() | 1) - }; - encoder_state[index] = (clockwise ^ 1) | (clockwise << 1); - action_exec(encoder_event); -} - -void matrix_scan_user(void) { - encoder_action_unregister(); -} - -bool encoder_update_user(uint8_t index, bool clockwise) { - encoder_action_register(index, clockwise); - return false; -} -#endif diff --git a/keyboards/doio/kb16/keymaps/via/rules.mk b/keyboards/doio/kb16/keymaps/via/rules.mk deleted file mode 100644 index 1e5b99807c..0000000000 --- a/keyboards/doio/kb16/keymaps/via/rules.mk +++ /dev/null @@ -1 +0,0 @@ -VIA_ENABLE = yes |