adb_usb: Add mouse extended report support
This commit is contained in:
parent
51ceca97f7
commit
82a562bd81
2 changed files with 6 additions and 1 deletions
|
|
@ -39,6 +39,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
/* Locking resynchronize hack */
|
/* Locking resynchronize hack */
|
||||||
#define LOCKING_RESYNC_ENABLE
|
#define LOCKING_RESYNC_ENABLE
|
||||||
|
|
||||||
|
// Mouse Extended Report
|
||||||
|
#define MOUSE_EXT_REPORT
|
||||||
|
|
||||||
|
|
||||||
/* ADB port setting */
|
/* ADB port setting */
|
||||||
#define ADB_PORT PORTD
|
#define ADB_PORT PORTD
|
||||||
|
|
|
||||||
|
|
@ -346,8 +346,10 @@ void adb_mouse_task(void)
|
||||||
x = xx * mouseacc;
|
x = xx * mouseacc;
|
||||||
y = yy * mouseacc;
|
y = yy * mouseacc;
|
||||||
|
|
||||||
|
#ifndef MOUSE_EXT_REPORT
|
||||||
x = (x > 127) ? 127 : ((x < -127) ? -127 : x);
|
x = (x > 127) ? 127 : ((x < -127) ? -127 : x);
|
||||||
y = (y > 127) ? 127 : ((y < -127) ? -127 : y);
|
y = (y > 127) ? 127 : ((y < -127) ? -127 : y);
|
||||||
|
#endif
|
||||||
|
|
||||||
if (scroll_enable) {
|
if (scroll_enable) {
|
||||||
scroll_state -= y;
|
scroll_state -= y;
|
||||||
|
|
@ -364,7 +366,7 @@ void adb_mouse_task(void)
|
||||||
mouse_report.y = y;
|
mouse_report.y = y;
|
||||||
}
|
}
|
||||||
|
|
||||||
dmprintf("[B:%02X X:%d(%d) Y:%d(%d) A:%d]\n", mouse_report.buttons, mouse_report.x, xx, mouse_report.y, yy, mouseacc);
|
dmprintf("[B:%02X X:%d(%d) Y:%d(%d) V:%d A:%d]\n", mouse_report.buttons, mouse_report.x, xx, mouse_report.y, yy, mouse_report.v, mouseacc);
|
||||||
|
|
||||||
// Send result by usb.
|
// Send result by usb.
|
||||||
host_mouse_send(&mouse_report);
|
host_mouse_send(&mouse_report);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue