mirror of
https://github.com/qmk/qmk_firmware.git
synced 2024-11-26 21:26:46 +00:00
e624ce959a
Co-authored-by: jack <0x6a73@protonmail.com>
21 lines
700 B
C
21 lines
700 B
C
// Copyright 2022 QMK
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
#include "quantum.h"
|
|
|
|
// This will be overridden by encoder map in all default keymaps, but serves as a catch-all for user keymaps that may omit the map.
|
|
#if defined (ENCODER_ENABLE) && !defined (ENCODER_MAP_ENABLE)
|
|
bool encoder_update_kb(uint8_t index, bool clockwise) {
|
|
if (!encoder_update_user(index, clockwise)) {
|
|
return false; /* Don't process further events if user function exists and returns false */
|
|
}
|
|
if (index == 0) { /* First encoder */
|
|
if (clockwise) {
|
|
tap_code_delay(KC_VOLU, 10);
|
|
} else {
|
|
tap_code_delay(KC_VOLD, 10);
|
|
}
|
|
}
|
|
return true;
|
|
}
|
|
#endif |