Jules_nerd wrote on 2026-08-27, 10:57:
Excellent stuff!
I suppose that others have found linux (which distro/version?) to be OK must just be random luck that it has a longer delay? TBH I tend to use a PS2mouse, but on the few occasions Ive done it I didnt notice an issue with windows? I guess that must also have a longer delay?
Windows 3.x waits for 2 ticks, then resets again, and then waits for 8 ticks, so yes, it has a longer delay*. That said, even with these, I have seen Windows fail to detect the mouse, likely because the second reset may be done before the first has finished, and therefore delaying the reply from the 2nd reset... . On 9x I have a similar issue, or sometimes device manager will show the (!) sign on the device , or sometimes it will complain about no mouse installed (... and sometimes will do so even when the touchpad appears to work 😜 ). But overall I'd say for Windows it works about 70% of the time, while for DOS/Cutemouse it worked only about 30% of the time before the patch.
It's only NT , Linux, OS/2 who don't seem to have this issue, and my wild guess is because they may have better hotplug support . i.e. if you plug the mouse while running , are they supposed to detect it w/o rebooting ? When the mouse "hello" message arrives late, it just looks as if you hotplugged it. Linux (gpm or X) for sure doesn't care, dunno about the rest.
*EDIT: Actually, the normal MOUSE.DRV waits for 4 ticks, so it's slightly better than CTMOUSE there but still short, which explains the result. I can patch that one to also wait for 8 ticks and it improves the success ratio significantly.
In addition, it seems LMOUSE.DRV (the Logitech one) uses a different strategy (not yet known to me) which works a lot better, dunno why, albeit it doesn't have PS/2 support so I prefer MOUSE.DRV .
Jules_nerd wrote on 2026-08-27, 10:57:
I think we had a misunderstanding earlier, or maybe I got it wrong I cant remember, I agree that the 8051/ST micro is doing the translation, but I'm guessing there may be another driver IC on the trackpad/LCD?? so is there a possibility the issue is with that? After typing.. I suppose the 8051 code is the most likely candidate...
From the schematic I saw TFT and CTP lines coming to the 8051, and when I google that, I get hits of generic "3.5 TFT with capacitive touch panel" kits and the like, which I think makes sense. So there may be an IC there, but it is just part of the generic touch kit, and my guess is that this sends just the touch coordinates to the 8051, which then uses it to simulate the serial mouse and that goes into the COM2 UART (via the clearly marked COM2 TX/RX pins). I did not find how the COM2 RTS/CTS goes into the 8051 but it's likely there too.
The only other alternative would be some touch screen with an actual serial mouse interface (i.e. like a touchpad from a real laptop), and that doesn't seem the case, first because then the 8051 would needlessly be in the middle (why not connect such real touchpad directly to the M5113?) , and second because I've been trying to send stuff via COM2 and this doesn't act like any (real) serial touchpad that Linux knows.
Actually it just doesn't seem to do nothing with data sent to it. It just gives the 'M3' signature back when you reset it. Which identifies it as a MS 3 button, even though it doesn't have a 3rd button 😀 (also explains why Cutemouse calls it "logitech").
Jules_nerd wrote on 2026-08-27, 10:57:
Whilst we cant easily re-do the code... if we had more details on the trackpad - which I guess is just an LCD with a captouch interface & a couple of separate switches... maybe it might be possible to bypass that part of the existing 8051 (hoping the code will still run with no response from the trackpad controller?) & add another micro that does these switches and the captouch translation to serial mouse protocol part? lift the COM2 pins on the exiting 8051 and connect our own micro to those pins no the m6117?
Yes, albeit you need to figure out how to also read the other RS232 signals like CTS/RTS to detect when the host is trying to reset you.
EDIT: actually I realize I missed the RTS2# in the schematic, which clearly is bringing the COM2 RTS from the M5113 in to the 8051. So that explains it 😀 That's all the signals you need to emulate a serial mouse.
Good thing that he wired the COM2 TX line, even if it seems useless now, is in the future a custom serial mouse emulator could switch to a "serial touchpad" mode for the OSes that support it . And gain support for two finger scroll or sth 😀
Also: the FN+3 hotkey simply disables sending the 'M3' signature when the host toggles the RTS line (reset). The 8051 will still happily send mouse movement, but it will not send the signature, so most mouse drivers will fail to detect anything.