Skip to content

Commit

Permalink
Change: don't send mouse_report if not moving
Browse files Browse the repository at this point in the history
  • Loading branch information
otomon10 committed Jan 29, 2021
1 parent 4bfb737 commit 5caf5a9
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion quantum/pointing_device.c
Expand Up @@ -24,6 +24,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "pointing_device.h"

static report_mouse_t mouseReport = {};
static bool mouseReportUpdated = false;

__attribute__ ((weak))
void pointing_device_init(void){
Expand All @@ -50,7 +51,10 @@ void pointing_device_task(void){
//mouseReport.h = 127 max -127 min (scroll horizontal)
//mouseReport.buttons = 0x1F (decimal 31, binary 00011111) max (bitmask for mouse buttons 1-5, 1 is rightmost, 5 is leftmost) 0x00 min
//send the report
pointing_device_send();
if (mouseReportUpdated) {
pointing_device_send();
mouseReportUpdated = false;
}
}

report_mouse_t pointing_device_get_report(void){
Expand All @@ -59,4 +63,5 @@ report_mouse_t pointing_device_get_report(void){

void pointing_device_set_report(report_mouse_t newMouseReport){
mouseReport = newMouseReport;
mouseReportUpdated = true;
}

0 comments on commit 5caf5a9

Please sign in to comment.