logo

qmk_firmware

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

keymap.c (758B)


  1. #include QMK_KEYBOARD_H
  2. const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
  3. [0] = LAYOUT(
  4. KC_P7, KC_P8, KC_P9, KC_PMNS,
  5. KC_P4, KC_P5, KC_P6, KC_PPLS,
  6. KC_MUTE, KC_P1, KC_P2, KC_P3, KC_TAB,
  7. KC_ESC, KC_DEL, KC_P0, KC_PDOT, KC_PENT
  8. )
  9. };
  10. bool encoder_update_user(uint8_t index, bool clockwise) {
  11. if (index == 0) { /* First encoder below the controller */
  12. if (clockwise) {
  13. tap_code(KC_VOLD); /*volume down*/
  14. } else {
  15. tap_code(KC_VOLU); /*volume up*/
  16. }
  17. } else if (index == 1) { /* Second encoder */
  18. if (clockwise) {
  19. tap_code(KC_WH_U); /*mouse wheel up*/
  20. } else {
  21. tap_code(KC_WH_D); /*mouse wheel down*/
  22. }
  23. }
  24. return true;
  25. }