0
votes

I want to generate mouse events (like clicking and moving the pointer) in an android application. I made a lot of researchs about this kind of implementations and finally I found that it is the only way to do this from arm assembly level. I will use jni to call c routines and those c routines will have inline arm assembly codes. But I have a problem about using interrupts in arm processor that generates mouse events. I know that in intel chipsets, "int 33h" interrupt handles the mouse events. Can someone help me about mouse function interrupts in arm processor and how to use it.

Thanks.

1
Have you looked into how the 'monkey' application (developer.android.com/guide/developing/tools/monkey.html) injects mouse events? I believe it uses a /dev device.P.T.

1 Answers

0
votes

I've implemented this and it's a bit tricky. I decided not to publish the app because there are too many "ifs" to make it work in a universal way. You will need to send the proper data to the correct /dev/device. The device name/number is different on each manufacturer and you will need to enumerate the devices and search for a match based on the name. It also requires that you run as a native linux app (not Java or NDK) with root privilege. Start by looking at how linux works with touch and mouse input.