ibmpc_usb: Add mouse extended report support
This commit is contained in:
parent
231b288ed9
commit
51ceca97f7
2 changed files with 13 additions and 5 deletions
|
|
@ -43,7 +43,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
#define G80_2551_SUPPORT
|
#define G80_2551_SUPPORT
|
||||||
|
|
||||||
// PS/2 Mouse support
|
// PS/2 Mouse support
|
||||||
#define IBMPC_MOUSE_ENABLE
|
//#define IBMPC_MOUSE_ENABLE
|
||||||
|
|
||||||
|
// Mouse Extended Report
|
||||||
|
//#define MOUSE_EXT_REPORT
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
||||||
|
|
@ -574,10 +574,15 @@ MOUSE_DONE:
|
||||||
#define CHOP8(a) (((a) > 127) ? 127 : (((a) < -127) ? -127 : (a)))
|
#define CHOP8(a) (((a) > 127) ? 127 : (((a) < -127) ? -127 : (a)))
|
||||||
report_mouse_t mouse_report = {};
|
report_mouse_t mouse_report = {};
|
||||||
mouse_report.buttons = mouse_btn;
|
mouse_report.buttons = mouse_btn;
|
||||||
mouse_report.x = CHOP8(x);
|
#ifdef MOUSE_EXT_REPORT
|
||||||
mouse_report.y = -(CHOP8(y));
|
mouse_report.x = x;
|
||||||
mouse_report.v = -(CHOP8(v));
|
mouse_report.y = -y;
|
||||||
mouse_report.h = CHOP8(h);
|
#else
|
||||||
|
mouse_report.x = CHOP8(x);
|
||||||
|
mouse_report.y = -CHOP8(y);
|
||||||
|
#endif
|
||||||
|
mouse_report.v = -CHOP8(v);
|
||||||
|
mouse_report.h = CHOP8(h);
|
||||||
host_mouse_send(&mouse_report);
|
host_mouse_send(&mouse_report);
|
||||||
xprintf("M[x:%d y:%d v:%d h:%d b:%02X]\n", mouse_report.x, mouse_report.y,
|
xprintf("M[x:%d y:%d v:%d h:%d b:%02X]\n", mouse_report.x, mouse_report.y,
|
||||||
mouse_report.v, mouse_report.h, mouse_report.buttons);
|
mouse_report.v, mouse_report.h, mouse_report.buttons);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue