keymap.c 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /* Copyright 2018 Jack Humbert
  2. *
  3. * This program is free software: you can redistribute it and/or modify
  4. * it under the terms of the GNU General Public License as published by
  5. * the Free Software Foundation, either version 2 of the License, or
  6. * (at your option) any later version.
  7. *
  8. * This program is distributed in the hope that it will be useful,
  9. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. * GNU General Public License for more details.
  12. *
  13. * You should have received a copy of the GNU General Public License
  14. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  15. */
  16. #include "qwiic_hub.h"
  17. const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
  18. [0] = LAYOUT_ortho_2x2(
  19. KC_TAB, KC_SPACE,
  20. KC_LSFT, KC_ENT
  21. )
  22. };
  23. void encoder_update_user(int8_t index, bool clockwise) {
  24. switch(index) {
  25. case 0:
  26. if (clockwise) {
  27. register_code(KC_MS_WH_DOWN);
  28. unregister_code(KC_MS_WH_DOWN);
  29. } else {
  30. register_code(KC_MS_WH_UP);
  31. unregister_code(KC_MS_WH_UP);
  32. }
  33. break;
  34. case 1:
  35. if (clockwise) {
  36. register_code(KC_PGDN);
  37. unregister_code(KC_PGDN);
  38. } else {
  39. register_code(KC_PGUP);
  40. unregister_code(KC_PGUP);
  41. }
  42. break;
  43. case 2:
  44. break;
  45. case 3:
  46. break;
  47. }
  48. }
  49. bool process_record_user(uint16_t keycode, keyrecord_t *record) {
  50. return true;
  51. }
  52. void matrix_scan_user(void) {
  53. }