mouse.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com>
  2. * Copyright 2019 Sunjun Kim
  3. * Copyright 2020 Ploopy Corporation
  4. *
  5. * This program is free software: you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation, either version 2 of the License, or
  8. * (at your option) any later version.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. #pragma once
  19. #include "quantum.h"
  20. #include "spi_master.h"
  21. #include "pmw3360.h"
  22. #include "analog.h"
  23. #include "opt_encoder.h"
  24. #include "pointing_device.h"
  25. // Sensor defs
  26. #define OPT_ENC1 F0
  27. #define OPT_ENC2 F4
  28. #define OPT_ENC1_MUX 0
  29. #define OPT_ENC2_MUX 4
  30. void process_mouse(report_mouse_t* mouse_report);
  31. void process_mouse_user(report_mouse_t* mouse_report, int16_t x, int16_t y);
  32. void process_wheel(report_mouse_t* mouse_report);
  33. void process_wheel_user(report_mouse_t* mouse_report, int16_t h, int16_t v);
  34. #define LAYOUT(BLL, BL, BM, BR, BRR, BF, BB, BDPI) \
  35. { {BL, BM, BR, BF, BB, BRR, BLL, BDPI}, }
  36. typedef union {
  37. uint32_t raw;
  38. struct {
  39. uint8_t dpi_config;
  40. };
  41. } keyboard_config_t;
  42. extern keyboard_config_t keyboard_config;
  43. extern uint16_t dpi_array[];
  44. enum ploopy_keycodes {
  45. #ifdef VIA_ENABLE
  46. DPI_CONFIG = USER00,
  47. #else
  48. DPI_CONFIG = SAFE_RANGE,
  49. #endif
  50. DRAG_SCROLL,
  51. #ifdef VIA_ENABLE
  52. PLOOPY_SAFE_RANGE = SAFE_RANGE,
  53. #else
  54. PLOOPY_SAFE_RANGE,
  55. #endif
  56. };