Clear the report at the end of a move mouse or scroll mouse macro

This commit is contained in:
Eric Tang
2018-06-26 15:32:16 -07:00
parent d35a7cc644
commit 633a6cec77

View File

@@ -318,16 +318,32 @@ bool processMouseButtonAction(void)
bool processMoveMouseAction(void)
{
MacroMouseReport.x = currentMacroAction.moveMouse.x;
MacroMouseReport.y = currentMacroAction.moveMouse.y;
return false;
static bool inMotion;
if (inMotion) {
memset(&MacroMouseReport, 0, sizeof MacroMouseReport);
inMotion = false;
} else {
MacroMouseReport.x = currentMacroAction.moveMouse.x;
MacroMouseReport.y = currentMacroAction.moveMouse.y;
inMotion = true;
}
return inMotion;
}
bool processScrollMouseAction(void)
{
MacroMouseReport.wheelX = currentMacroAction.scrollMouse.x;
MacroMouseReport.wheelY = currentMacroAction.scrollMouse.y;
return false;
static bool inMotion;
if (inMotion) {
memset(&MacroMouseReport, 0, sizeof MacroMouseReport);
inMotion = false;
} else {
MacroMouseReport.wheelX = currentMacroAction.scrollMouse.x;
MacroMouseReport.wheelY = currentMacroAction.scrollMouse.y;
inMotion = true;
}
return inMotion;
}
bool processTextAction(void)