diff options
Diffstat (limited to 'keyboards/ploopyco/mouse/mouse.c')
-rw-r--r-- | keyboards/ploopyco/mouse/mouse.c | 25 |
1 files changed, 4 insertions, 21 deletions
diff --git a/keyboards/ploopyco/mouse/mouse.c b/keyboards/ploopyco/mouse/mouse.c index 7e44feaf7..788a0a1f0 100644 --- a/keyboards/ploopyco/mouse/mouse.c +++ b/keyboards/ploopyco/mouse/mouse.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 | ||
@@ -171,31 +171,14 @@ bool process_record_kb(uint16_t keycode, keyrecord_t* record) { | |||
171 | if (IS_MOUSEKEY_BUTTON(keycode)) { | 171 | if (IS_MOUSEKEY_BUTTON(keycode)) { |
172 | report_mouse_t currentReport = pointing_device_get_report(); | 172 | report_mouse_t currentReport = pointing_device_get_report(); |
173 | if (record->event.pressed) { | 173 | if (record->event.pressed) { |
174 | if (keycode == KC_MS_BTN1) | 174 | currentReport.buttons |= 1 << (keycode - KC_MS_BTN1); |
175 | currentReport.buttons |= MOUSE_BTN1; | ||
176 | else if (keycode == KC_MS_BTN2) | ||
177 | currentReport.buttons |= MOUSE_BTN2; | ||
178 | else if (keycode == KC_MS_BTN3) | ||
179 | currentReport.buttons |= MOUSE_BTN3; | ||
180 | else if (keycode == KC_MS_BTN4) | ||
181 | currentReport.buttons |= MOUSE_BTN4; | ||
182 | else if (keycode == KC_MS_BTN5) | ||
183 | currentReport.buttons |= MOUSE_BTN5; | ||
184 | } else { | 175 | } else { |
185 | if (keycode == KC_MS_BTN1) | 176 | currentReport.buttons &= ~(1 << (keycode - KC_MS_BTN1)); |
186 | currentReport.buttons &= ~MOUSE_BTN1; | ||
187 | else if (keycode == KC_MS_BTN2) | ||
188 | currentReport.buttons &= ~MOUSE_BTN2; | ||
189 | else if (keycode == KC_MS_BTN3) | ||
190 | currentReport.buttons &= ~MOUSE_BTN3; | ||
191 | else if (keycode == KC_MS_BTN4) | ||
192 | currentReport.buttons &= ~MOUSE_BTN4; | ||
193 | else if (keycode == KC_MS_BTN5) | ||
194 | currentReport.buttons &= ~MOUSE_BTN5; | ||
195 | } | 177 | } |
196 | pointing_device_set_report(currentReport); | 178 | pointing_device_set_report(currentReport); |
197 | pointing_device_send(); | 179 | pointing_device_send(); |
198 | } | 180 | } |
181 | |||
199 | #endif | 182 | #endif |
200 | 183 | ||
201 | return true; | 184 | return true; |