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.

32 lines
710 B

  1. #include "quantum.h"
  2. __attribute__ ((weak))
  3. void matrix_init_kb(void) {
  4. // Turn status LED on, with the exception of THK
  5. #if defined(__AVR_ATmega32U4__)
  6. setPinOutput(E6);
  7. writePinHigh(E6);
  8. #endif
  9. matrix_init_user();
  10. }
  11. #ifdef ENCODER_ENABLE
  12. bool encoder_update_kb(uint8_t index, bool clockwise) {
  13. if (!encoder_update_user(index, clockwise)) { return false; }
  14. if (get_highest_layer(layer_state) > 0) {
  15. if (clockwise) {
  16. tap_code_delay(KC_VOLU, 10);
  17. } else {
  18. tap_code_delay(KC_VOLD, 10);
  19. }
  20. } else {
  21. if (clockwise) {
  22. tap_code(KC_PGDN);
  23. } else {
  24. tap_code(KC_PGUP);
  25. }
  26. }
  27. return true;
  28. }
  29. #endif