pelya / android-keyboard-gadget

Convert your Android device into USB keyboard/mouse, control your PC from your Android device remotely, including BIOS/bootloader.
Apache License 2.0
1.22k stars 308 forks source link

mouse event not work #109

Closed Drolmen closed 6 years ago

Drolmen commented 6 years ago

mouse event not work at windows 10 and macOS Sierra 10.12.6 , but working well at Ubuntu. I use Nexus 5 with android 5.0 system. I use this kernek for nexus 5 . Please help me.

Drolmen commented 6 years ago

I have fix this issue.As follows: adb shell su echo -e -n "\x0\x{X}\x{Y}\x0" > /dev/hidg1

{X} is distance at X axis, {Y} is distance at Y axis

michaeliwaikato commented 6 years ago

Hi there, do you think you can share how you worked this out and whether you got the mouse buttons to work please? I would very much appreciate it!

Drolmen commented 6 years ago

@michaeliwaikato Yes, i have fixed this successful. You should directly write bytes that contain 4 byte to dest file (/dev/hidg1). Cmd as above, not use "./hid-gadget-test"。

michaeliwaikato commented 6 years ago

@Drolmen Ok thanks for that. Have you had any issues in windows 10 where a normal mouse no longer works properly after using the command above? I have been having issues where I can't click on other applications or on the taskbar if I run some commands using the format above.

Drolmen commented 6 years ago

There is a useful software named USB Monitor for widnows. You can capture the data sended to windows. Hope to help you.

michaeliwaikato commented 6 years ago

I have put some info in #135 if it is useful to anyone who finds this issue with the mouse. Thanks again @Drolmen for your help it is very much appreciated