KeyMapper icon indicating copy to clipboard operation
KeyMapper copied to clipboard

Long Press Not Working with Constraints

Open githubsterer opened this issue 10 months ago • 11 comments

Developer TODO (don't remove)

  • [ ] update documentation

Describe the bug Not sure if this has been reported, so apologies in advance if so.

Scenario is as follows.

Both short press and long press volume buttons are constrained when media is playing but only the short press actually works to change the volume whereas the long press does nothing. It does suppress the action but does not rapidly change the volume as expected.

UPDATE: this happens even when the single press is disabled so it's not an issue exclusive to when there are both key maps. It's something with the long press on its own.

githubsterer avatar Mar 31 '25 17:03 githubsterer

UPDATE 2: This is happening even with both volume key maps disabled. It's the app itself causing this on its own because the only way to get the long press to work on the volume keys is to actually pause the entire app.

githubsterer avatar Mar 31 '25 17:03 githubsterer

Could you give a specific example to test, and what you expect it to do?

jambl3r avatar Mar 31 '25 17:03 jambl3r

When playing media I expect the long press of a volume key to rapidly change the volume.

I initially discovered this does not work when having a key map triggered by the long press volume key but constrained not to do the action (and thus should allow the volume key to operate as expected) when media is playing. That does not work.

I then disabled the key map entirely expecting at least that to cause the long press volume key to work at expected but that too fails.

Only when I pause the app does the long press volume key work as expected by rapidly changing the volume. In both of the cases above it does not change the volume at all.

githubsterer avatar Mar 31 '25 17:03 githubsterer

Interestingly, I'm only seeing this with the down volume long press. Up volume long press works. Strange.

githubsterer avatar Mar 31 '25 17:03 githubsterer

Oh man this is a weird one, I just figured it out. Give me a sec to write it up.

All I can say is, you couldn't pay enough for this kind of testing! Maybe I'll get a mention in the credits one day for all this :-)

githubsterer avatar Mar 31 '25 17:03 githubsterer

Take either volume key, they work the same.

When you assign key maps to all three press types and apply the same no media, no phone constraints to all three, then the long press works as expected to rapidly change the volume.

If you remove the constraints from the double press, then the long press stops working. Once you restore those constraints, the long press resumes working as expected.

What's strange is that when it doesn't work, it performs neither function. It does not do the action and it does not adjust the volume.

githubsterer avatar Mar 31 '25 17:03 githubsterer

Idk if it is exactly the same bug, but I installed the app (and allowed for accessibility options) on my android tv and volume up/down buttons always increase volume by one increment. So when I click volume button it works as expected (increase volume by one) but when I hold key it also increases volume only by one - which is not desired (it should continue increasing volume until I stop holding volume key - this is how it works when app is uninstalled). AND I only installed app and allowed for accessibility option; I haven't added any mappings to buttons or anything else.

Dani3I avatar Apr 20 '25 07:04 Dani3I

@Dani3I - This is intended behaviour because you have not told Key Mapper that you want the action to repeat when you hold down the key.

You can achieve what you're looking for by turning on Repeat in the action settings. The app defaults are pretty good as-is.

Screenshot_20250420-204841.png

jambl3r avatar Apr 20 '25 19:04 jambl3r

@Dani3I - This is intended behaviour because you have not told Key Mapper that you want the action to repeat when you hold down the key.

You can achieve what you're looking for by turning on Repeat in the action settings. The app defaults are pretty good as-is.

Screenshot_20250420-204841.png

Should this application not work in such a way that when nothing is set, then all buttons work as if the application was not there?

Dani3I avatar Apr 21 '25 00:04 Dani3I

Probably to some degree. We've made repeat the default for the next update, see #1657

jambl3r avatar Apr 21 '25 08:04 jambl3r

This volume button issue is not because of the app. It is beacuse of the android os code. Apparently there is a code in the ROM which blocks the default behaviour of the longpress volume button when ever accessibility service is turned on.

neilmahaseth avatar Sep 28 '25 12:09 neilmahaseth