KeyMapper
KeyMapper copied to clipboard
Impossible to specify press&hold A -> press&release B -> release A
Developer TODO (don't remove)
- [ ] create new branch. put issue number at start of name if not a very quick fix.
- [ ] write tests. put issue number in comment
- [ ] update documentation
- [ ] squash and merge
- [ ] delete branch
Discord message link/email recipient
N/A
Describe the bug
It's impossible to specify the type of sequence from the title. Namely press & hold key A then press & release key B then release key A.
This is exactly the sequence which e.g. certain Samsung phones use for their touch buttons (Recents and Back buttons).
E.g. the sequence press & hold Recents -> press & release Back -> release Recents triggers the "Show power menu" action.
The reversed sequence press & hold Back -> press & release Recents -> release Back triggers the Go Home action.
Optionally you can put almost arbitrary delay (I've tried ~3 seconds) between the last two steps (i.e. right before the release Back or release Recents) to better test the step (7) from below.
To Reproduce Steps to reproduce the behavior:
- open Key Mapper
- press
+at the bottom - press
RECORD TRIGGER - press one of the sequences above
- under
ACTIONSpressADD ACTION, switch toSYSTEM, scroll to the bottom and chooseDo nothing - under
OPTIONSselectVibrateto make sure the sequence triggered - try the sequence from any app or home screen (it doesn't matter) - it'll vibrate but long before the original Samsung action triggers
Note, I've played with all combinations:
a. At the same time with Short press
b. At the same time with Long press
c. In sequence
But it behaves the same :cry:.
Note also other key bindings I use in Key Mapper work very well.
Expected behavior
There should be a way to overwrite the default behavior by specifying the press & hold state somehow.
Screenshots
N/A
Smartphone (please complete the following information):
- Device: Samsungs with true separate capacitive touch buttons (i.e. not imitated in SW by using the capacitive display screen) - e.g. Samsung J5
- Android version: Android 7.1.1
Additional context
N/A
Related: https://github.com/keymapperorg/KeyMapper/issues/875 , https://github.com/keymapperorg/KeyMapper/issues/817 .
Btw. reading through some of the issues and corresponding patches/commits, I'm really impressed. This is an awesome piece of SW! Thanks @sds100 a lot!
Today I found a workaround to the problem. Just click + in Key Mapper, press RECORD TRIGGER, then press and release Recents button, then choose Long press, then choose the Nothing action in the ACTIONS tab. Do the same again but this time with Short press option. Analogically add two separate key bindings for the Back key.
Having these four independent separate key bindings surprisingly prevents the built-in shortcuts to trigger. At least on Samsung J5.
I can not explain why this workaround works, but it seems to work flawlessly :open_mouth:. For Apple users this might feel like a heavenly relief.
I'm curious whether this workaround works for others - anyone?
Hi, well you seem to have found a solution 😄. I have never thought about this use case so the fact that it works is a side effect of how I've implemented the other features. You basically want to sequence triggers, but the keys can be pressed, held and then released in a non-sequential order.
You basically want to sequence triggers, but the keys can be pressed, held and then released in a non-sequential order.
Yes. Do you still plan to implement it at some point (as you enthusiastically wrote in https://github.com/keymapperorg/KeyMapper/issues/875 )?
Strictly speaking I do not need it right now (due to the "workaround" above - which might be temporary though as in any new version you might change the behavior and the side effects will be different).
But I am generally interested in the idea to create more complex triggers (especially useful on new devices with just a very few HW buttons - therefore maximizing their utilization through hightened number of possible combinations :wink:).