You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
625 B

  1. /* Copyright 2020 David Philip Barr <@davidphilipbarr>
  2. * Copyright 2021 @filterpaper
  3. * SPDX-License-Identifier: GPL-2.0+
  4. */
  5. #include "macro3.h"
  6. #ifdef ENCODER_ENABLE
  7. bool encoder_update_kb(uint8_t index, bool clockwise) {
  8. if (!encoder_update_user(index, clockwise)) { return false; }
  9. if (index == 0) {
  10. if (clockwise) {
  11. tap_code_delay(KC_VOLU, 10);
  12. } else {
  13. tap_code_delay(KC_VOLD, 10);
  14. }
  15. } else if (index == 1) {
  16. if (clockwise) {
  17. tap_code(KC_MNXT);
  18. } else {
  19. tap_code(KC_MPRV);
  20. }
  21. }
  22. return true;
  23. }
  24. #endif