javaandroidusb-otg

How to catch signals from a unknown USB OTG device?


I have a USB OTG device which acts like a mouse, bought in china with not much more information about the used controller. When I connect it to my android there is a mouse cursor and the device has 5 hard buttons (left, right, up, down, enter). I want to programm the buttons for my app to performe specific tasks. So I need to read the input signals and overwrite them.

How can I catch the signals?

I found out the vendor (0x04D9) and product id (0x2519) and the controller name Lenovo Calliope USB Keyboard. But no idea about the used chip, it's covert.

It doesn't work with the methods onKeyDown or dispatchKeyEvent. Also not with USB serial Lib because the device is not found/ recognized with the provided VID und PID (see discussion with Fatih Şennik below, other devices are recognized with it).

My current assumption is that it is a Hardware/ Chip issue that I cannot get the signals. But the strange thing is that the device otherwise does what it is supposed to do.


Solution

  • The solution if nothings works: I got an arduino controller and solder it to the buttons. It's not that complicated.

    Important is that the controller supports hid e.g. the leonardo pro micro with the atmega32u4 chip. The code for the controller can be found easily with google.

    Then it works with override onKeyDown or onKeyUp etc.