logo

qmk_firmware

custom branch of QMK firmware git clone https://anongit.hacktivis.me/git/qmk_firmware.git

preonic.c (505B)


  1. #include "quantum.h"
  2. #ifdef ENCODER_ENABLE
  3. bool encoder_update_kb(uint8_t index, bool clockwise) {
  4. if (!encoder_update_user(index, clockwise)) { return false; }
  5. if (get_highest_layer(layer_state) > 0) {
  6. if (clockwise) {
  7. tap_code_delay(KC_VOLU, 10);
  8. } else {
  9. tap_code_delay(KC_VOLD, 10);
  10. }
  11. } else {
  12. if (clockwise) {
  13. tap_code(KC_PGDN);
  14. } else {
  15. tap_code(KC_PGUP);
  16. }
  17. }
  18. return true;
  19. }
  20. #endif