etchamouse.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /* Copyright 2020 Stephen J. Bush
  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. #pragma once
  17. #if defined(POINTING_DEVICE_ENABLE) && defined(ENCODER_ENABLE)
  18. /* max value on report descriptor */
  19. # ifndef MOUSEKEY_MOVE_MAX
  20. # define MOUSEKEY_MOVE_MAX 127
  21. # elif MOUSEKEY_MOVE_MAX > 127
  22. # error MOUSEKEY_MOVE_MAX needs to be smaller than 127
  23. # endif
  24. # ifndef MOUSEKEY_MOVE_DELTA
  25. # define MOUSEKEY_MOVE_DELTA 25
  26. # endif
  27. # ifndef MOUSEKEY_INITIAL_SPEED
  28. # define MOUSEKEY_INITIAL_SPEED 100
  29. # endif
  30. # ifndef MOUSEKEY_INTERVAL
  31. # define MOUSEKEY_INTERVAL 75
  32. # endif
  33. /** Amount of time (ms) before zeroing out the count.
  34. * A higher value will result in smoother curves but may lower accuracy
  35. */
  36. # ifndef TAPPING_TERM_PERSISTENCE
  37. # define TAPPING_TERM_PERSISTENCE 150
  38. # endif
  39. /** Amount of time (ms) to register consecutive key presses
  40. * A higher value will smooth out mouse movement and increase speed for
  41. * consecutive presses.
  42. */
  43. # ifndef TAPPING_TERM_MOUSE_ENCODER
  44. # define TAPPING_TERM_MOUSE_ENCODER 50
  45. # endif
  46. /** @brief Update mouse position based on encoder movement.
  47. * @param index The encoder index. 0 controls x-axis; 1 controls y-axis.
  48. * @param clockwise Indicates direction encoder was turned.
  49. * @returns None.
  50. */
  51. bool encoder_update_mouse(uint8_t index, bool clockwise);
  52. #endif