The big issue: modern mouses all come with mouse wheels, and we don't have a way to map them (there's also the problem that most mouses lack a fourth button, but oh well). We could just ignore the wheel, but why not instead actually expose it? But we're gonna need to standarize on a packet format or everybody will do whatever they feel like it.
Anyway, here's my proposal for how to extend the data fed back by the mouse, considering what stuff existing games seem to ignore (note that only 3rd nibble is different from a stock Mega Mouse):
Code: Select all
1st - 1 0 1 1
2nd - 1 1 1 1
3rd - 1 1 WD WU
4th - Yo Xo Ys Xs
5th - C M R L
6th - X7 X6 X5 X4
7th - X3 X2 X1 X0
8th - Y7 Y6 Y5 Y4
9th - Y3 Y2 Y1 Y0
- X7-X0: X axis displacement (two's complement)
- Y7-Y0: Y axis displacement (two's complement)
- Xs: X axis sign extension
- Ys: Y axis sign extension
- Xo: 1 = X axis overflowed (invalid), 0 otherwise
- Yo: 1 = Y axis overflowed (invalid), 0 otherwise
- WU: 0 = wheel up, 1 otherwise
- WD: 0 = wheel down, 1 otherwise
- L: 1 = left button pressed, 0 otherwise
- R: 1 = middle button pressed, 0 otherwise
- M: 1 = right button pressed, 0 otherwise
- C: 1 = Start button pressed, 0 otherwise
If anybody is looking into making a new mouse adapter, consider looking at this please?
EDIT: I may as well include how the packet would look with the full extensions:
Code: Select all
1st - 1 0 1 1
2nd - B7 B6 B5 B4
3rd - WR WL WD WU
4th - Yo Xo Ys Xs
5th - C M R L
6th - X7 X6 X5 X4
7th - X3 X2 X1 X0
8th - Y7 Y6 Y5 Y4
9th - Y3 Y2 Y1 Y0
- X7-X0: X axis displacement (two's complement)
- Y7-Y0: Y axis displacement (two's complement)
- Xs: X axis sign extension
- Ys: Y axis sign extension
- Xo: 1 = X axis overflowed (invalid), 0 otherwise
- Yo: 1 = Y axis overflowed (invalid), 0 otherwise
- WU: 0 = wheel up, 1 otherwise
- WD: 0 = wheel down, 1 otherwise
- WL: 0 = wheel left, 1 otherwise
- WR: 0 = wheel right, 1 otherwise
- L: 1 = left button pressed, 0 otherwise
- R: 1 = middle button pressed, 0 otherwise
- M: 1 = right button pressed, 0 otherwise
- C: 1 = Start button pressed, 0 otherwise
- B4: 0 = 5th button pressed, 1 otherwise
- B5: 0 = 6th button pressed, 1 otherwise
- B6: 0 = 7th button pressed, 1 otherwise
- B7: 0 = 8th button pressed, 1 otherwise
- Avoid the value -0 (treat it like +0)
- Avoid the value -256 (treat it like overflow)
- Maybe even replace overflow with a clamped value instead (works around bugs in one game with a seemingly broken mouse routine)