Merge remote-tracking branch 'qmk/master' into merge-2022-07-11
This commit is contained in:
commit
fde0c10bae
7121 changed files with 170388 additions and 28118 deletions
|
|
@ -16,6 +16,7 @@
|
|||
*/
|
||||
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include "keycode.h"
|
||||
#include "host.h"
|
||||
#include "timer.h"
|
||||
|
|
@ -210,7 +211,7 @@ static uint8_t wheel_unit(void) {
|
|||
|
||||
void mousekey_task(void) {
|
||||
// report cursor and scroll movement independently
|
||||
report_mouse_t const tmpmr = mouse_report;
|
||||
report_mouse_t tmpmr = mouse_report;
|
||||
|
||||
mouse_report.x = 0;
|
||||
mouse_report.y = 0;
|
||||
|
|
@ -252,8 +253,10 @@ void mousekey_task(void) {
|
|||
}
|
||||
}
|
||||
|
||||
if (mouse_report.x || mouse_report.y || mouse_report.v || mouse_report.h) mousekey_send();
|
||||
mouse_report = tmpmr;
|
||||
if (has_mouse_report_changed(&mouse_report, &tmpmr) || should_mousekey_report_send(&mouse_report)) {
|
||||
mousekey_send();
|
||||
}
|
||||
memcpy(&mouse_report, &tmpmr, sizeof(tmpmr));
|
||||
}
|
||||
|
||||
void mousekey_on(uint8_t code) {
|
||||
|
|
@ -357,11 +360,11 @@ uint16_t w_intervals[mkspd_COUNT] = {MK_W_INTERVAL_UNMOD, MK_W_INTERVAL_0
|
|||
|
||||
void mousekey_task(void) {
|
||||
// report cursor and scroll movement independently
|
||||
report_mouse_t const tmpmr = mouse_report;
|
||||
mouse_report.x = 0;
|
||||
mouse_report.y = 0;
|
||||
mouse_report.v = 0;
|
||||
mouse_report.h = 0;
|
||||
report_mouse_t tmpmr = mouse_report;
|
||||
mouse_report.x = 0;
|
||||
mouse_report.y = 0;
|
||||
mouse_report.v = 0;
|
||||
mouse_report.h = 0;
|
||||
|
||||
if ((tmpmr.x || tmpmr.y) && timer_elapsed(last_timer_c) > c_intervals[mk_speed]) {
|
||||
mouse_report.x = tmpmr.x;
|
||||
|
|
@ -372,8 +375,10 @@ void mousekey_task(void) {
|
|||
mouse_report.h = tmpmr.h;
|
||||
}
|
||||
|
||||
if (mouse_report.x || mouse_report.y || mouse_report.v || mouse_report.h) mousekey_send();
|
||||
mouse_report = tmpmr;
|
||||
if (has_mouse_report_changed(&mouse_report, &tmpmr) || should_mousekey_report_send(&mouse_report)) {
|
||||
mousekey_send();
|
||||
}
|
||||
memcpy(&mouse_report, &tmpmr, sizeof(tmpmr));
|
||||
}
|
||||
|
||||
void adjust_speed(void) {
|
||||
|
|
@ -523,3 +528,7 @@ static void mousekey_debug(void) {
|
|||
report_mouse_t mousekey_get_report(void) {
|
||||
return mouse_report;
|
||||
}
|
||||
|
||||
bool should_mousekey_report_send(report_mouse_t *mouse_report) {
|
||||
return mouse_report->x || mouse_report->y || mouse_report->v || mouse_report->h;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue