aboutsummaryrefslogtreecommitdiff
path: root/keyboards/ploopyco/trackball/trackball.c
diff options
context:
space:
mode:
Diffstat (limited to 'keyboards/ploopyco/trackball/trackball.c')
-rw-r--r--keyboards/ploopyco/trackball/trackball.c24
1 files changed, 3 insertions, 21 deletions
diff --git a/keyboards/ploopyco/trackball/trackball.c b/keyboards/ploopyco/trackball/trackball.c
index 7b7b68027..94f284346 100644
--- a/keyboards/ploopyco/trackball/trackball.c
+++ b/keyboards/ploopyco/trackball/trackball.c
@@ -140,7 +140,7 @@ __attribute__((weak)) void process_mouse(report_mouse_t* mouse_report) {
140 if (debug_mouse) dprintf("Cons] X: %d, Y: %d\n", data.dx, data.dy); 140 if (debug_mouse) dprintf("Cons] X: %d, Y: %d\n", data.dx, data.dy);
141 // dprintf("Elapsed:%u, X: %f Y: %\n", i, pgm_read_byte(firmware_data+i)); 141 // dprintf("Elapsed:%u, X: %f Y: %\n", i, pgm_read_byte(firmware_data+i));
142 142
143 process_mouse_user(mouse_report, data.dx, data.dy); 143 process_mouse_user(mouse_report, data.dx, -data.dy);
144 } 144 }
145} 145}
146 146
@@ -172,27 +172,9 @@ bool process_record_kb(uint16_t keycode, keyrecord_t* record) {
172 if (IS_MOUSEKEY_BUTTON(keycode)) { 172 if (IS_MOUSEKEY_BUTTON(keycode)) {
173 report_mouse_t currentReport = pointing_device_get_report(); 173 report_mouse_t currentReport = pointing_device_get_report();
174 if (record->event.pressed) { 174 if (record->event.pressed) {
175 if (keycode == KC_MS_BTN1) 175 currentReport.buttons |= 1 << (keycode - KC_MS_BTN1);
176 currentReport.buttons |= MOUSE_BTN1;
177 else if (keycode == KC_MS_BTN2)
178 currentReport.buttons |= MOUSE_BTN2;
179 else if (keycode == KC_MS_BTN3)
180 currentReport.buttons |= MOUSE_BTN3;
181 else if (keycode == KC_MS_BTN4)
182 currentReport.buttons |= MOUSE_BTN4;
183 else if (keycode == KC_MS_BTN5)
184 currentReport.buttons |= MOUSE_BTN5;
185 } else { 176 } else {
186 if (keycode == KC_MS_BTN1) 177 currentReport.buttons &= ~(1 << (keycode - KC_MS_BTN1));
187 currentReport.buttons &= ~MOUSE_BTN1;
188 else if (keycode == KC_MS_BTN2)
189 currentReport.buttons &= ~MOUSE_BTN2;
190 else if (keycode == KC_MS_BTN3)
191 currentReport.buttons &= ~MOUSE_BTN3;
192 else if (keycode == KC_MS_BTN4)
193 currentReport.buttons &= ~MOUSE_BTN4;
194 else if (keycode == KC_MS_BTN5)
195 currentReport.buttons &= ~MOUSE_BTN5;
196 } 178 }
197 pointing_device_set_report(currentReport); 179 pointing_device_set_report(currentReport);
198 pointing_device_send(); 180 pointing_device_send();