ibmpc_usb: Add mouse extended report support

This commit is contained in:
tmk 2021-06-21 22:45:57 +09:00
parent 231b288ed9
commit 51ceca97f7
2 changed files with 13 additions and 5 deletions

View file

@ -43,7 +43,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define G80_2551_SUPPORT
// PS/2 Mouse support
#define IBMPC_MOUSE_ENABLE
//#define IBMPC_MOUSE_ENABLE
// Mouse Extended Report
//#define MOUSE_EXT_REPORT
/*

View file

@ -574,9 +574,14 @@ MOUSE_DONE:
#define CHOP8(a) (((a) > 127) ? 127 : (((a) < -127) ? -127 : (a)))
report_mouse_t mouse_report = {};
mouse_report.buttons = mouse_btn;
#ifdef MOUSE_EXT_REPORT
mouse_report.x = x;
mouse_report.y = -y;
#else
mouse_report.x = CHOP8(x);
mouse_report.y = -(CHOP8(y));
mouse_report.v = -(CHOP8(v));
mouse_report.y = -CHOP8(y);
#endif
mouse_report.v = -CHOP8(v);
mouse_report.h = CHOP8(h);
host_mouse_send(&mouse_report);
xprintf("M[x:%d y:%d v:%d h:%d b:%02X]\n", mouse_report.x, mouse_report.y,