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.

86 lines
2.0 KiB

  1. /*
  2. Copyright 2011 Jun Wako <wakojun@gmail.com>
  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. #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_WHEEL_MAX
  25. #define MOUSEKEY_WHEEL_MAX 127
  26. #elif MOUSEKEY_WHEEL_MAX > 127
  27. #error MOUSEKEY_WHEEL_MAX needs to be smaller than 127
  28. #endif
  29. #ifndef MOUSEKEY_MOVE_DELTA
  30. #define MOUSEKEY_MOVE_DELTA 5
  31. #endif
  32. #ifndef MOUSEKEY_WHEEL_DELTA
  33. #define MOUSEKEY_WHEEL_DELTA 1
  34. #endif
  35. #ifndef MOUSEKEY_DELAY
  36. #define MOUSEKEY_DELAY 300
  37. #endif
  38. #ifndef MOUSEKEY_INTERVAL
  39. #define MOUSEKEY_INTERVAL 50
  40. #endif
  41. #ifndef MOUSEKEY_MAX_SPEED
  42. #define MOUSEKEY_MAX_SPEED 10
  43. #endif
  44. #ifndef MOUSEKEY_TIME_TO_MAX
  45. #define MOUSEKEY_TIME_TO_MAX 20
  46. #endif
  47. #ifndef MOUSEKEY_WHEEL_MAX_SPEED
  48. #define MOUSEKEY_WHEEL_MAX_SPEED 8
  49. #endif
  50. #ifndef MOUSEKEY_WHEEL_TIME_TO_MAX
  51. #define MOUSEKEY_WHEEL_TIME_TO_MAX 40
  52. #endif
  53. #ifdef __cplusplus
  54. extern "C" {
  55. #endif
  56. extern uint8_t mk_delay;
  57. extern uint8_t mk_interval;
  58. extern uint8_t mk_max_speed;
  59. extern uint8_t mk_time_to_max;
  60. extern uint8_t mk_wheel_max_speed;
  61. extern uint8_t mk_wheel_time_to_max;
  62. void mousekey_task(void);
  63. void mousekey_on(uint8_t code);
  64. void mousekey_off(uint8_t code);
  65. void mousekey_clear(void);
  66. void mousekey_send(void);
  67. #ifdef __cplusplus
  68. }
  69. #endif
  70. #endif