]> git.donarmstrong.com Git - qmk_firmware.git/blob - tmk_core/common/mousekey.h
Do some cleanup for the API
[qmk_firmware.git] / tmk_core / common / mousekey.h
1 /*
2 Copyright 2011 Jun Wako <wakojun@gmail.com>
3
4 This program is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation, either version 2 of the License, or
7 (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License
15 along with this program.  If not, see <http://www.gnu.org/licenses/>.
16 */
17
18 #ifndef MOUSEKEY_H
19 #define  MOUSEKEY_H
20
21 #include <stdbool.h>
22 #include "host.h"
23
24
25 /* max value on report descriptor */
26 #ifndef MOUSEKEY_MOVE_MAX
27     #define MOUSEKEY_MOVE_MAX       127
28 #elif MOUSEKEY_MOVE_MAX > 127
29     #error MOUSEKEY_MOVE_MAX needs to be smaller than 127
30 #endif
31
32 #ifndef MOUSEKEY_WHEEL_MAX
33     #define MOUSEKEY_WHEEL_MAX      127
34 #elif MOUSEKEY_WHEEL_MAX > 127
35     #error MOUSEKEY_WHEEL_MAX needs to be smaller than 127
36 #endif
37
38 #ifndef MOUSEKEY_MOVE_DELTA
39 #define MOUSEKEY_MOVE_DELTA     5
40 #endif
41 #ifndef MOUSEKEY_WHEEL_DELTA
42 #define MOUSEKEY_WHEEL_DELTA    1
43 #endif
44 #ifndef MOUSEKEY_DELAY
45 #define MOUSEKEY_DELAY 300
46 #endif
47 #ifndef MOUSEKEY_INTERVAL
48 #define MOUSEKEY_INTERVAL 50
49 #endif
50 #ifndef MOUSEKEY_MAX_SPEED
51 #define MOUSEKEY_MAX_SPEED 10
52 #endif
53 #ifndef MOUSEKEY_TIME_TO_MAX
54 #define MOUSEKEY_TIME_TO_MAX 20
55 #endif
56 #ifndef MOUSEKEY_WHEEL_MAX_SPEED
57 #define MOUSEKEY_WHEEL_MAX_SPEED 8
58 #endif
59 #ifndef MOUSEKEY_WHEEL_TIME_TO_MAX
60 #define MOUSEKEY_WHEEL_TIME_TO_MAX 40
61 #endif
62
63
64 #ifdef __cplusplus
65 extern "C" {
66 #endif
67
68 extern uint8_t mk_delay;
69 extern uint8_t mk_interval;
70 extern uint8_t mk_max_speed;
71 extern uint8_t mk_time_to_max;
72 extern uint8_t mk_wheel_max_speed;
73 extern uint8_t mk_wheel_time_to_max;
74
75
76 void mousekey_task(void);
77 void mousekey_on(uint8_t code);
78 void mousekey_off(uint8_t code);
79 void mousekey_clear(void);
80 void mousekey_send(void);
81
82 #ifdef __cplusplus
83 }
84 #endif
85
86 #endif