Skip to content

Commit

Permalink
Fixup Pointing device functions (#20311)
Browse files Browse the repository at this point in the history
  • Loading branch information
drashna authored Apr 1, 2023
1 parent 9359504 commit bf98657
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions docs/feature_pointing_device.md
Original file line number Diff line number Diff line change
Expand Up @@ -713,15 +713,15 @@ _Note: The Cirque pinnacle track pad already implements a custom activation func
When using a custom pointing device (overwriting `pointing_device_task`) the following code should be somewhere in the `pointing_device_task_*` stack:
```c
void pointing_device_task(void) {
bool pointing_device_task(void) {
//...Custom pointing device task code
// handle automatic mouse layer (needs report_mouse_t as input)
pointing_device_task_auto_mouse(local_mouse_report);
//...More custom pointing device task code
pointing_device_send();
return pointing_device_send();
}
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ void trackball_set_scrolling(bool scroll) { scrolling = scroll; }

__attribute__((weak)) void pointing_device_init(void) { trackball_set_rgbw(0x80, 0x00, 0x00, 0x00); }

void pointing_device_task(void) {
bool pointing_device_task(void) {
static bool debounce;
static uint16_t debounce_timer;
uint8_t state[5] = {};
Expand Down Expand Up @@ -173,5 +173,5 @@ void pointing_device_task(void) {
update_member(&mouse.v, &h_offset);
#endif
pointing_device_set_report(mouse);
pointing_device_send();
return pointing_device_send();
}
4 changes: 2 additions & 2 deletions keyboards/crkbd/keymaps/vlukash_trackpad_right/trackpad.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ uint8_t readRegister(uint8_t address) {
return data;
}

void pointing_device_task(void){
bool pointing_device_task(void){
uint8_t motion = readRegister(0x02);

// Motion has occurred on the trackpad
Expand Down Expand Up @@ -73,6 +73,6 @@ void pointing_device_task(void){
}

pointing_device_set_report(currentReport);
pointing_device_send();
}
return pointing_device_send();
}
4 changes: 2 additions & 2 deletions keyboards/dichotomy/dichotomy.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

//#include "uart.h"

void pointing_device_task(void){
bool pointing_device_task(void){
/*report_mouse_t currentReport = {};
uint32_t timeout = 0;
Expand Down Expand Up @@ -56,7 +56,7 @@ void pointing_device_task(void){
} else {
xprintf("\r\nRequested packet, data 4 was %d",uart_data[4]);
}*/
pointing_device_send();
return pointing_device_send();
}

void led_init(void) {
Expand Down
4 changes: 2 additions & 2 deletions keyboards/keyhive/honeycomb/honeycomb.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#include "pointing_device.h"
#include "report.h"

void pointing_device_task(void){
bool pointing_device_task(void){
/*report_mouse_t currentReport = {};
uint32_t timeout = 0;
Expand Down Expand Up @@ -56,7 +56,7 @@ void pointing_device_task(void){
} else {
xprintf("\r\nRequested packet, data 4 was %d",uart_data[4]);
}*/
pointing_device_send();
return pointing_device_send();
}

void led_init(void) {
Expand Down
6 changes: 3 additions & 3 deletions keyboards/molecule/adns.c
Original file line number Diff line number Diff line change
Expand Up @@ -237,11 +237,11 @@ motion_delta_t readSensor(void) {
return delta;
}

void pointing_device_task(void) {
bool pointing_device_task(void) {
motion_delta_t delta = readSensor();

report_mouse_t report = pointing_device_get_report();

if(delta.motion_ind) {
// clamp deltas from -127 to 127
report.x = delta.delta_x < -127 ? -127 : delta.delta_x > 127 ? 127 : delta.delta_x;
Expand All @@ -250,5 +250,5 @@ void pointing_device_task(void) {
}

pointing_device_set_report(report);
pointing_device_send();
return pointing_device_send();
}
4 changes: 2 additions & 2 deletions keyboards/splitkb/kyria/keymaps/gotham/thumbstick.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ void update_keycode_status(uint16_t keycode, bool last, bool current) {

void pointing_device_init(void) { thumbstick_init(); }

void pointing_device_task(void) {
bool pointing_device_task(void) {
report_mouse_t report = pointing_device_get_report();

if (!isLeftHand) {
Expand Down Expand Up @@ -191,5 +191,5 @@ void pointing_device_task(void) {
}

pointing_device_set_report(report);
pointing_device_send();
return pointing_device_send();
}

0 comments on commit bf98657

Please sign in to comment.