keymap.c 990 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #include QMK_KEYBOARD_H
  2. const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
  3. /*
  4. * ,-----------------------,
  5. * | 7 | 8 | 9 | / |
  6. * |-----+-----+-----+-----|
  7. * | 4 | 5 | 6 | * |
  8. * |-----+-----+-----+-----|
  9. * | 1 | 2 | 3 | - |
  10. * |-----+-----+-----+-----|
  11. * | 0 | . | = | + |
  12. * `-----------------------'
  13. */
  14. LAYOUT_ortho_4x4(
  15. KC_P7, KC_P8, KC_P9, KC_PSLS,
  16. KC_P4, KC_P5, KC_P6, KC_PAST,
  17. KC_P1, KC_P2, KC_P3, KC_PMNS,
  18. KC_P0, KC_PDOT, KC_PEQL, KC_PPLS
  19. )
  20. };
  21. // Set led state during powerup
  22. void keyboard_post_init_user(void) {
  23. writePinHigh(LED_RED);
  24. }
  25. void encoder_update_user(uint8_t index, bool clockwise) {
  26. if (index == 0) { // First encoder - top left
  27. if (clockwise) {
  28. tap_code(KC_UP);
  29. } else {
  30. tap_code(KC_DOWN);
  31. }
  32. } else if (index == 1) { // Second encoder - top right
  33. if (clockwise) {
  34. tap_code(KC_UP);
  35. } else {
  36. tap_code(KC_DOWN);
  37. }
  38. }
  39. }