]> git.donarmstrong.com Git - qmk_firmware.git/blob - tmk_core/common/mousekey.h
Update KBD67 readme so that it mentions the KBD65 PCB (#5143)
[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 #endif
21
22 #include <stdbool.h>
23 #include "host.h"
24
25 #ifndef MK_3_SPEED
26
27 /* max value on report descriptor */
28 #ifndef MOUSEKEY_MOVE_MAX
29   #define MOUSEKEY_MOVE_MAX       127
30 #elif MOUSEKEY_MOVE_MAX > 127
31   #error MOUSEKEY_MOVE_MAX needs to be smaller than 127
32 #endif
33
34 #ifndef MOUSEKEY_WHEEL_MAX
35   #define MOUSEKEY_WHEEL_MAX      127
36 #elif MOUSEKEY_WHEEL_MAX > 127
37   #error MOUSEKEY_WHEEL_MAX needs to be smaller than 127
38 #endif
39
40 #ifndef MOUSEKEY_MOVE_DELTA
41 #define MOUSEKEY_MOVE_DELTA     5
42 #endif
43 #ifndef MOUSEKEY_WHEEL_DELTA
44 #define MOUSEKEY_WHEEL_DELTA    1
45 #endif
46 #ifndef MOUSEKEY_DELAY
47 #define MOUSEKEY_DELAY 300
48 #endif
49 #ifndef MOUSEKEY_INTERVAL
50 #define MOUSEKEY_INTERVAL 50
51 #endif
52 #ifndef MOUSEKEY_MAX_SPEED
53 #define MOUSEKEY_MAX_SPEED 10
54 #endif
55 #ifndef MOUSEKEY_TIME_TO_MAX
56 #define MOUSEKEY_TIME_TO_MAX 20
57 #endif
58 #ifndef MOUSEKEY_WHEEL_MAX_SPEED
59 #define MOUSEKEY_WHEEL_MAX_SPEED 8
60 #endif
61 #ifndef MOUSEKEY_WHEEL_TIME_TO_MAX
62 #define MOUSEKEY_WHEEL_TIME_TO_MAX 40
63 #endif
64
65 #else /* #ifndef MK_3_SPEED */
66
67 #ifndef MK_C_OFFSET_SLOW
68 #define MK_C_OFFSET_SLOW 1
69 #endif
70 #ifndef MK_C_INTERVAL_SLOW
71 #define MK_C_INTERVAL_SLOW 100
72 #endif
73 #ifndef MK_C_OFFSET_MED
74 #define MK_C_OFFSET_MED 4
75 #endif
76 #ifndef MK_C_INTERVAL_MED
77 #define MK_C_INTERVAL_MED 16
78 #endif
79 #ifndef MK_C_OFFSET_FAST
80 #define MK_C_OFFSET_FAST 12
81 #endif
82 #ifndef MK_C_INTERVAL_FAST
83 #define MK_C_INTERVAL_FAST 16
84 #endif
85
86 #ifndef MK_W_OFFSET_SLOW
87 #define MK_W_OFFSET_SLOW 1
88 #endif
89 #ifndef MK_W_INTERVAL_SLOW
90 #define MK_W_INTERVAL_SLOW 400
91 #endif
92 #ifndef MK_W_OFFSET_MED
93 #define MK_W_OFFSET_MED 1
94 #endif
95 #ifndef MK_W_INTERVAL_MED
96 #define MK_W_INTERVAL_MED 200
97 #endif
98 #ifndef MK_W_OFFSET_FAST
99 #define MK_W_OFFSET_FAST 1
100 #endif
101 #ifndef MK_W_INTERVAL_FAST
102 #define MK_W_INTERVAL_FAST 100
103 #endif
104
105 #endif /* #ifndef MK_3_SPEED */
106
107 #ifdef __cplusplus
108 extern "C" {
109 #endif
110
111 extern uint8_t mk_delay;
112 extern uint8_t mk_interval;
113 extern uint8_t mk_max_speed;
114 extern uint8_t mk_time_to_max;
115 extern uint8_t mk_wheel_max_speed;
116 extern uint8_t mk_wheel_time_to_max;
117
118 void mousekey_task(void);
119 void mousekey_on(uint8_t code);
120 void mousekey_off(uint8_t code);
121 void mousekey_clear(void);
122 void mousekey_send(void);
123
124 #ifdef __cplusplus
125 }
126 #endif