Trying to automate Touch on my app.

201 views
Skip to first unread message

manoj ganesh

unread,
Jun 9, 2021, 12:25:55 PM6/9/21
to Kivy users support
Hi, I have been developing an app using python with kivy.
Now my objective is to make an automatic touch on (x,y) coordinate. I have been searching the whole internet but could not get the solution, so i finally ended up here. So, please help me on my problem.

"How to automate a touch on (x,y) coordinate?" i.e. "how to automatically make a touch_down on my desired position?"

Please help me.

Robert

unread,
Jun 9, 2021, 12:46:10 PM6/9/21
to Kivy users support

manoj ganesh

unread,
Jun 9, 2021, 1:07:07 PM6/9/21
to kivy-...@googlegroups.com
I saw all those, but my requirement is different.

In those cases they get the position after user touches.

But in my case, I want it to make a touch down event on x,y without actually touching physically.

Pls help me with my senario.

--
You received this message because you are subscribed to a topic in the Google Groups "Kivy users support" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/kivy-users/r5jrcGyomQo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to kivy-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/2c6b3840-b09f-4e61-a864-3cee522418a7n%40googlegroups.com.

Elliot Garbus

unread,
Jun 9, 2021, 1:10:11 PM6/9/21
to kivy-...@googlegroups.com

Expand on your desired use case.  Why do you want to do that?  What do you want to happen?

--
You received this message because you are subscribed to the Google Groups "Kivy users support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/CAN-_kZ64RWESNL-CQ6MsWLmkXz%3D9Qa%3DWBseD4OyinRDVL2Y9XQ%40mail.gmail.com.

 

aldo hasibuan

unread,
Jun 9, 2021, 1:40:50 PM6/9/21
to kivy-...@googlegroups.com
Hi,

I have also been looking for this. In my case I want to do automated testing on a GUI I developed for a touchscreen Raspberry Pi. I looked at PyAutoGUI but it can only emulate mouse and keyboard events


Elliot Garbus

unread,
Jun 9, 2021, 1:44:29 PM6/9/21
to kivy-...@googlegroups.com

manoj ganesh

unread,
Jun 9, 2021, 11:52:57 PM6/9/21
to kivy-...@googlegroups.com
It's an hand recognition virtual mouse for android device. I had my hand recognised, I used pynput to make the mouse activities in windows, but Im struck on performing touch activities in android.
That's my case.

Elliot Garbus

unread,
Jun 10, 2021, 9:31:27 AM6/10/21
to kivy-...@googlegroups.com

Robert

unread,
Jun 10, 2021, 9:02:09 PM6/10/21
to Kivy users support
I think the key point here is if you cant do what you want to do with the Kivy API on Windows, then the same API on Android is not going to provide the functionality.

It sounds like you want to replicate the pynput behavior on Android.

If that is possible then probably it will be in Java generating the events called via pyjnius.
I say 'if' because it sound like a massive security risk to generate fake system input events, I'd be surprised if we are allowed to do it.
Also there is a risk of cyclical behavior from Kivy, but if you don't see that with pynput maybe the risk is not real.

You don't say how these mouse events are used, but if they are used within your app then generating fake system mouse events is clearly the wrong way to go. This would be a design issue rather than a programming issue; decode the mouse action from the touch event position.

If the mouse events are real system events used outside you app then it is probably not portable code, you can get a hint that this might be the case by reading https://pynput.readthedocs.io/en/latest/limitations.html
Reply all
Reply to author
Forward
0 new messages