1
0

[Keyboard] Guard encoder behaviour on projectcain/vault* (#25864)

Initial
This commit is contained in:
Jack Sangdahl
2025-12-09 11:55:21 +01:00
committed by GitHub
parent 34c2e99fb3
commit 6faca4d663
2 changed files with 8 additions and 4 deletions

View File

@@ -16,14 +16,16 @@
#include "quantum.h"
#ifdef ENCODER_ENABLE
bool encoder_update_kb(uint8_t index, bool clockwise) {
if (!encoder_update_user(index, clockwise)) { return false; }
if (index == 0) { /* First encoder */
if (clockwise) {
tap_code(KC_PGDN);
} else {
tap_code(KC_PGUP);
tap_code(KC_PGUP);
}
}
return true;
}
}
#endif

View File

@@ -16,20 +16,22 @@
#include "quantum.h"
#ifdef ENCODER_ENABLE
bool encoder_update_kb(uint8_t index, bool clockwise) {
if (!encoder_update_user(index, clockwise)) { return false; }
if (index == 0) { /* First encoder */
if (clockwise) {
tap_code(KC_PGDN);
} else {
tap_code(KC_PGUP);
tap_code(KC_PGUP);
}
} else if (index == 1) { /* Second encoder */
if (clockwise) {
tap_code(KC_DOWN);
tap_code(KC_DOWN);
} else {
tap_code(KC_UP);
}
}
return true;
}
#endif