[Keyboard] Updated Kintsugi to support encoder mapping (#18492)
This commit is contained in:
parent
f8c8005ce1
commit
848e1ec318
15 changed files with 663 additions and 186 deletions
|
@ -1,4 +1,4 @@
|
|||
/* Copyright 2021 adpenrose
|
||||
/* Copyright 2022 adpenrose
|
||||
*
|
||||
* 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
|
||||
|
@ -16,34 +16,6 @@
|
|||
|
||||
#include "kintsugi.h"
|
||||
|
||||
/* Encoder */
|
||||
#ifdef ENCODER_ENABLE
|
||||
bool encoder_update_kb(uint8_t index, bool clockwise) {
|
||||
if (!encoder_update_user(index, clockwise)) {
|
||||
return false;
|
||||
} else {
|
||||
/* The switch case allows for different encoder mappings on different layers, "default" map gets applied for all unspecified layers */
|
||||
switch(get_highest_layer(layer_state)){
|
||||
case 1:
|
||||
if (clockwise) {
|
||||
tap_code(KC_MNXT);
|
||||
} else {
|
||||
tap_code(KC_MPRV);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
if (clockwise){
|
||||
tap_code(KC_VOLU);
|
||||
} else{
|
||||
tap_code(KC_VOLD);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef OLED_ENABLE
|
||||
oled_rotation_t oled_init_kb(oled_rotation_t rotation) {
|
||||
return OLED_ROTATION_270;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue