Teensy Two Mouse modification / demo


Well-known member
I was recently trying to hook up 4 rotary encoders to a computer through a Teensy (3.2) using mouse emulation, but ran into an issue with the 3rd and 4th mouse axes not behaving like the first two. Upon searching, I found similar discussion in this thread: https://forum.pjrc.com/index.php?th...d-axis-operates-at-reduced-resolutions.69151/ ... which appeared to be unresolved.

To me, it looked like the simplest solution was to modify the Teensy USB descriptor to have two mice, then simply use X and Y on each mouse to get the four axes. This assumes that your software can differentiate between the mice... for example, MAME has a "multimouse" option. With a little bit of effort I was able to get it working, and figured I'd post it here in case anyone else finds it helpful.

I've only tested it with a Teensy 3.2... and while it should work similarly with other Teensy boards, it'll probably require some minor modifications to make it work (at least to boards.txt to enable it on other boards... and probably applying similar changes to the .c, .cpp, and .h files in the teensy4 directory for the Teensy 4.x).

Anyway, if you try it out, be sure to post if you have success or run into any issues.



  • two_mouse_demo.zip
    37.5 KB · Views: 4