keymapperorg / KeyMapper

**DEVELOPMENT STOPPED**.📱 An Android app that change what the buttons do on your devices!
http://docs.keymapper.club
GNU General Public License v3.0
944 stars 146 forks source link

Pinch does not work in all map solutions #1201

Closed DagJenssen closed 3 weeks ago

DagJenssen commented 5 months ago

Developer TODO (don't remove)

Discord message link/email recipient

Describe the bug When trying to add a button trigger to pinch the screen to zoom in maps, it only works outwards(pinch out), never inwards, pinch in also zooms out. Tested in Google Maps , and the only thing missing to get full Google Maps control with our remote controller.

To Reproduce Steps to reproduce the behavior: Make trigger to react on - (minus) from a Keyboard. Set Action to Pinch in or out with start point in the middle of the screen. Pinch distance set to default 200px, finger count to 2, pinch duration default 200ms. (I have tried a lot of different timings and lenghts)

Upload a backup of your keymaps. Follow the guide here

Expected behavior A clear and concise description of what you expected to happen. Zoom in and out of Google Maps.

Screenshots Screenshot_20240116_203653_Key Mapper

Smartphone (please complete the following information):

Additional context Add any other context about the problem here.

DagJenssen commented 5 months ago

Just to add to this information. In an app like Sygic Maps, the pinch will only zoom out, ie the opposite of Google Maps.

Tams80 commented 5 months ago

I don't think pinch to zoom works at all. For me, only pinch out 'works'. Pinch in slightly scrolls the canvas.

I don't think pinch out works as a pinch though, as a two finger tap zooms out. So I think only a two finger tap is being detected.

sds100 commented 3 weeks ago

@pixel-shock can you look into this?

pixel-shock commented 3 weeks ago

I'll have a look into this

pixel-shock commented 3 weeks ago

@DagJenssen can you try to set the duration to like 1500ms?

pixel-shock commented 3 weeks ago

@sds100, @DagJenssen ,

I did some testing and you are right that the pinch out in google maps isn't working as well as it should be with certain certain amounts of duration and distance. BUT ... in Locus Maps the exact same setting is working absolutely fine for me, every time.

As far as I know the implementation for gestures is handled by the app itself and not system wide ... so currently my approach is to try different durations and distances and try to find one which works with google maps.

I am really sorry to say that ... but basically what keymapper does in the background is this (for your example:

  1. create a circle at your X/Y coords and distribute an amount of points (finger count) on that
  2. simulate a finger move from those created points on that circle to the circle center (your X/Y)

that's all.

I've tried it with multiple rotation angles for that circle etc. but nothing worked properly in maps ... at least for me ... In Locus Maps, Calimoto and several other apps this pinch gesture is working.

DagJenssen commented 3 weeks ago

Hi Tino

No problem, Seth is hired by me for helping me creating the app Remotek which does the job. I had forgotten about this request.

Nice of you to look at it, though.

Kind regards Dag Dag Jenssen - Remotek AS @.*** Tlf +47 995 47 284 www.remotek.no Wireless controllers for iOs and Android

  1. juni 2024 kl. 16:47 skrev Tino W. @.***>:

@sds100 https://github.com/sds100, @DagJenssen https://github.com/DagJenssen ,

I did some testing and you are right that the pinch out in google maps isn't working as well as it should be with certain certain amounts of duration and distance. BUT ... in Locus Maps the exact same setting is working absolutely fine for me, every time.

As far as I know the implementation for gestures is handled by the app itself and not system wide ... so currently my approach is to try different durations and distances and try to find one which works with google maps.

I am really sorry to say that ... but basically what keymapper does in the background is this (for your example:

create a circle at your X/Y coords and distribute an amount of points (finger count) on that simulate a finger move from those created points on that circle to the circle center (your X/Y) that's all.

I've tried it with multiple rotation angles for that circle etc. but nothing worked properly in maps ... at least for me ... In Locus Maps, Calimoto and several other apps this pinch gesture is working.

— Reply to this email directly, view it on GitHub https://github.com/keymapperorg/KeyMapper/issues/1201#issuecomment-2163227513, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANWSQZ7XHCNV6BA7W2XKDE3ZHBNPTAVCNFSM6AAAAABB5LLD4KVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNRTGIZDONJRGM. You are receiving this because you were mentioned.

pixel-shock commented 3 weeks ago

Hi Dag,

I see, I see ... I am using the SilverFox Controller currently for exactly the same purpose you do ... but I am running calimoto etc. for my routes. But nontheless, if you and Seth can find a solution I would be very happy to get some details ... I have no idea why maps is handling the gestures so bad.

And by the way, maps is the only app on CarPlay for me, which does not handle pinch gestures in any way in my car ... that is totally strange.

Sadly the GestureBuilder API is very limited :-/ ... at least the official stuff ... but as I am not an android dev it's nearly impossible for me to develop workarounds for such problems :-/

DagJenssen commented 3 weeks ago

We are developing and selling the Remotek One controller, so it´s a competitor to the Silverfox, just better imho. But I am biased and have never touched the Silverfox.;)

Kind regards Dag Dag Jenssen - Remotek AS @.*** Tlf +47 995 47 284 www.remotek.no Wireless controllers for iOs and Android

  1. juni 2024 kl. 17:08 skrev Tino W. @.***>:

Hi Dag,

I see, I see ... I am using the SilverFox Controller currently for exactly the same purpose you do ... but I am running calimoto etc. for my routes. But nontheless, if you and Seth can find a solution I would be very happy to get some details ... I have no idea why maps is handling the gestures so bad.

And by the way, maps is the only app on CarPlay for me, which does not handle pinch gestures in any way in my car ... that is totally strange.

Sadly the GestureBuilder API is very limited :-/ ... at least the official stuff ... but as I am not an android dev it's nearly impossible for me to develop workarounds for such problems :-/

— Reply to this email directly, view it on GitHub https://github.com/keymapperorg/KeyMapper/issues/1201#issuecomment-2163283758, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANWSQZ3I3GU2MHNUHWBDKYLZHBQAFAVCNFSM6AAAAABB5LLD4KVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNRTGI4DGNZVHA. You are receiving this because you were mentioned.

sds100 commented 3 weeks ago

It seems like Google Maps needs its own solution, which is the one-handed "tap and swipe up/down" method of zooming in/out. This can already be done in Key Mapper with your work @pixel-shock. I'll close this since everyone has a solution and it seems to work as intended - besides some strangely behaving apps.

Screenshot_20240612-171459

pixel-shock commented 3 weeks ago

Oh man ... I didn't know about this solution ... I'll try it for me as well ... THX Seth 👍 🍻