Teensy 4.1 – Best USB mode for host keyboard+mouse and iPad taps?

Frozbee

New member
Hi,


I’m using a Teensy 4.1 with PlatformIO (USB_SERIAL_HID).


  • On the USB host port, I connect a wired keyboard and mouse (USBHost_t36).
  • On the USB device port, the Teensy is connected to an iPad.
  • Goal: when I press certain keys on the host keyboard, the Teensy should send a tap at fixed coordinates to the iPad, while the host mouse still works normally as a mouse.

Right now it works with USB_SERIAL_HID, but I need to add manual delay() between move/click/release for the tap to be detected reliably → which adds latency.


👉 My question:


  • Is USB_SERIAL_HID the correct USB mode for this?
  • Or should I switch to USB_HID_TOUCHSCREEN mode?
  • I have tried with USB_HID_TOUCHSCREEN it seems that the teensy 4.1 have trouble to recognize myu keyboard and mouse with this little hub
1759414706024.png

Thanks!
 
Last edited:
USB HUB 2.0.png


Hi again,


Here is a clearer diagram of what I’m trying to do:


  • On the USB host port of the Teensy 4.1, I plug a keyboard + mouse (through a USB 2.0 hub).
  • On the USB device port, the Teensy is connected to an USB c HUB going to an iPad.
  • Goal:
    • The host mouse should work normally (move the cursor).
    • The host keyboard should trigger touch taps at fixed coordinates on the iPad.



What I noticed:​


  • If I connect only the keyboard or only the mouse directly to the Teensy host port → it works fine.
  • But if I connect them via a USB 2.0 hub, things get unreliable: sometimes the keyboard or mouse is not detected properly, or inputs are missed.
    • Could it be because of the type of USB hub?
    • Do I need to use a powered hub to provide more current for both devices?



About USB modes:​

  • I also tried USB_HID_TOUCHSCREEN mode: sometimes it makes taps on the iPad, but most of the time nothing happens. Could this be interference or a power issue from the hub?
 
Back
Top