Monday 31 August 2020

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.

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.

How can I catch the signals?

It doesn't work with the methods onKeyDown or dispatchKeyEvent.

Side question, if I connect the device the first time the app crash but I can reopen it and it works fine... any idea?

Update: I bought the USB OTG device in china so I have not much information about the used controller. I found out that they use a 'Lenovo Calliope USB Keyboard' Controller with HID\VID_04D9&PID_2519&REV_0001.

Update 2: the code from Fatih Şennik works for other usb devices. So I have an hardware issue? But the controller does what he is supposed to do...



from How to catch signals from a unknown USB OTG device?

No comments:

Post a Comment