`sofle/via` encoder map & doc handedness update (#20630)
This commit is contained in:
parent
9b41e8168d
commit
a4b36f0b4b
|
@ -17,10 +17,9 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
/* The way how "handedness" is decided (which half is which),
|
/* By default left side is selected as master,
|
||||||
see https://docs.qmk.fm/#/feature_split_keyboard?id=setting-handedness
|
see https://docs.qmk.fm/#/feature_split_keyboard?id=setting-handedness
|
||||||
for more options.
|
for more options. */
|
||||||
*/
|
|
||||||
|
|
||||||
#if defined(KEYBOARD_sofle_rev1)
|
#if defined(KEYBOARD_sofle_rev1)
|
||||||
// Add RGB underglow and top facing lighting
|
// Add RGB underglow and top facing lighting
|
||||||
|
|
|
@ -1,39 +0,0 @@
|
||||||
/* Copyright 2020 Josef Adamcik
|
|
||||||
* Modification for VIA support and RGB underglow by Jens Bonk-Wiltfang
|
|
||||||
*
|
|
||||||
* 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/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
//Setting up what encoder rotation does. If your encoder can be pressed as a button, that function can be set in Via.
|
|
||||||
|
|
||||||
#ifdef ENCODER_ENABLE
|
|
||||||
|
|
||||||
bool encoder_update_user(uint8_t index, bool clockwise) {
|
|
||||||
if (index == 0) {
|
|
||||||
if (clockwise) {
|
|
||||||
tap_code(KC_VOLU);
|
|
||||||
} else {
|
|
||||||
tap_code(KC_VOLD);
|
|
||||||
}
|
|
||||||
} else if (index == 1) {
|
|
||||||
if (clockwise) {
|
|
||||||
tap_code(KC_PGDN);
|
|
||||||
} else {
|
|
||||||
tap_code(KC_PGUP);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
|
@ -17,9 +17,15 @@
|
||||||
|
|
||||||
#include QMK_KEYBOARD_H
|
#include QMK_KEYBOARD_H
|
||||||
#include "oled.c"
|
#include "oled.c"
|
||||||
#include "encoder.c"
|
|
||||||
|
|
||||||
//Default keymap. This can be changed in Via. Use oled.c and encoder.c to change beavior that Via cannot change.
|
#ifdef ENCODER_MAP_ENABLE
|
||||||
|
const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = {
|
||||||
|
[0] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU), ENCODER_CCW_CW(KC_PGDN, KC_PGUP) },
|
||||||
|
[1] = { ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(_______, _______) },
|
||||||
|
[2] = { ENCODER_CCW_CW(RGB_HUD, RGB_HUI), ENCODER_CCW_CW(RGB_SAD, RGB_SAI) },
|
||||||
|
[3] = { ENCODER_CCW_CW(RGB_VAD, RGB_VAI), ENCODER_CCW_CW(RGB_RMOD, RGB_MOD)}
|
||||||
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -6,3 +6,4 @@ EXTRAKEY_ENABLE = yes
|
||||||
VIA_ENABLE = yes
|
VIA_ENABLE = yes
|
||||||
LTO_ENABLE = yes
|
LTO_ENABLE = yes
|
||||||
RGBLIGHT_ENABLE = yes
|
RGBLIGHT_ENABLE = yes
|
||||||
|
ENCODER_MAP_ENABLE = yes
|
Loading…
Reference in New Issue