2 Copyright 2017 Joshua Broekhuijsen <snipeye+qmk@gmail.com>
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.
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.
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/>.
24 #include "pointing_device.h"
26 static report_mouse_t mouseReport
= {};
28 __attribute__((weak
)) void pointing_device_init(void) {
29 // initialize device, if that needs to be done.
32 __attribute__((weak
)) void pointing_device_send(void) {
33 // If you need to do other things, like debugging, this is the place to do it.
34 host_mouse_send(&mouseReport
);
35 // send it and 0 it out except for buttons, so those stay until they are explicity over-ridden using update_pointing_device
42 __attribute__((weak
)) void pointing_device_task(void) {
43 // gather info and put it in:
44 // mouseReport.x = 127 max -127 min
45 // mouseReport.y = 127 max -127 min
46 // mouseReport.v = 127 max -127 min (scroll vertical)
47 // mouseReport.h = 127 max -127 min (scroll horizontal)
48 // mouseReport.buttons = 0x1F (decimal 31, binary 00011111) max (bitmask for mouse buttons 1-5, 1 is rightmost, 5 is leftmost) 0x00 min
50 pointing_device_send();
53 report_mouse_t
pointing_device_get_report(void) { return mouseReport
; }
55 void pointing_device_set_report(report_mouse_t newMouseReport
) { mouseReport
= newMouseReport
; }