Keyboard firmwares for Atmel AVR and Cortex-M
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

mousekey.h 1.8KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. /*
  2. Copyright 2011 Jun Wako <[email protected]>
  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. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU General Public License for more details.
  11. You should have received a copy of the GNU General Public License
  12. along with this program. If not, see <http://www.gnu.org/licenses/>.
  13. */
  14. #ifndef MOUSEKEY_H
  15. #define MOUSEKEY_H
  16. #include <stdbool.h>
  17. #include "host.h"
  18. /* max value on report descriptor */
  19. #define MOUSEKEY_MOVE_MAX 127
  20. #define MOUSEKEY_WHEEL_MAX 127
  21. #ifndef MOUSEKEY_MOVE_DELTA
  22. #define MOUSEKEY_MOVE_DELTA 5
  23. #endif
  24. #ifndef MOUSEKEY_WHEEL_DELTA
  25. #define MOUSEKEY_WHEEL_DELTA 1
  26. #endif
  27. #ifndef MOUSEKEY_DELAY
  28. #define MOUSEKEY_DELAY 300
  29. #endif
  30. #ifndef MOUSEKEY_INTERVAL
  31. #define MOUSEKEY_INTERVAL 50
  32. #endif
  33. #ifndef MOUSEKEY_MAX_SPEED
  34. #define MOUSEKEY_MAX_SPEED 10
  35. #endif
  36. #ifndef MOUSEKEY_TIME_TO_MAX
  37. #define MOUSEKEY_TIME_TO_MAX 20
  38. #endif
  39. #ifndef MOUSEKEY_WHEEL_MAX_SPEED
  40. #define MOUSEKEY_WHEEL_MAX_SPEED 8
  41. #endif
  42. #ifndef MOUSEKEY_WHEEL_TIME_TO_MAX
  43. #define MOUSEKEY_WHEEL_TIME_TO_MAX 40
  44. #endif
  45. #ifdef __cplusplus
  46. extern "C" {
  47. #endif
  48. extern uint8_t mk_delay;
  49. extern uint8_t mk_interval;
  50. extern uint8_t mk_max_speed;
  51. extern uint8_t mk_time_to_max;
  52. extern uint8_t mk_wheel_max_speed;
  53. extern uint8_t mk_wheel_time_to_max;
  54. void mousekey_task(void);
  55. void mousekey_on(uint8_t code);
  56. void mousekey_off(uint8_t code);
  57. void mousekey_clear(void);
  58. void mousekey_send(void);
  59. #ifdef __cplusplus
  60. }
  61. #endif
  62. #endif