Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Weird behaviour when constraint is changed during long press. #739

Closed
5 tasks done
sds100 opened this issue Jul 13, 2021 · 3 comments
Closed
5 tasks done

Weird behaviour when constraint is changed during long press. #739

sds100 opened this issue Jul 13, 2021 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@sds100
Copy link
Collaborator

sds100 commented Jul 13, 2021

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
https://discord.com/channels/717499872219103263/717500546910650488/864295435195645953

Describe the bug
In my case, I have one keymap: long press volume up to toggle back flashlight when flashlight is on (constraint).
To get weird behaviour: (the attached log is from these repro steps)

  1. Turn on flashlight
  2. Long press volume up: flashlight will turn off, as expected
  3. Tap/short press volume up: flashlight will turn on, which is highly unexpected; as a) the action is for long press and b) the constraint is not met (as flashlight was off, while the keymap is constrained for flash on)
01:51:57.144  Down KEYCODE_VOLUME_UP, key code: 24, time since event: 152ms, device name: mtk-kpd, descriptor: f0d2e427e7a05eb6d316f5e14800c5ac7b6aee79, device id: 6, is external: false, meta state: 0, scan code: 115
01:51:57.151  Down KEYCODE_VOLUME_UP - consumed: true, key code: 24, time since event: 152ms, device name: mtk-kpd, descriptor: f0d2e427e7a05eb6d316f5e14800c5ac7b6aee79, device id: 6, is external: false, meta state: 0, scan code: 115
01:51:57.289  Performed action Toggle(lens=BACK), input event type: DOWN_UP, key meta state: 0
01:51:57.389  Up KEYCODE_VOLUME_UP, key code: 24, time since event: 2ms, device name: mtk-kpd, descriptor: f0d2e427e7a05eb6d316f5e14800c5ac7b6aee79, device id: 6, is external: false, meta state: 0, scan code: 115
01:51:57.390  Up KEYCODE_VOLUME_UP - consumed: false, key code: 24, time since event: 2ms, device name: mtk-kpd, descriptor: f0d2e427e7a05eb6d316f5e14800c5ac7b6aee79, device id: 6, is external: false, meta state: 0, scan code: 115
01:51:58.441  Down KEYCODE_VOLUME_UP, key code: 24, time since event: 151ms, device name: mtk-kpd, descriptor: f0d2e427e7a05eb6d316f5e14800c5ac7b6aee79, device id: 6, is external: false, meta state: 0, scan code: 115
01:51:58.442  Down KEYCODE_VOLUME_UP - consumed: true, key code: 24, time since event: 151ms, device name: mtk-kpd, descriptor: f0d2e427e7a05eb6d316f5e14800c5ac7b6aee79, device id: 6, is external: false, meta state: 0, scan code: 115
01:51:58.442  Up KEYCODE_VOLUME_UP, key code: 24, time since event: 86ms, device name: mtk-kpd, descriptor: f0d2e427e7a05eb6d316f5e14800c5ac7b6aee79, device id: 6, is external: false, meta state: 0, scan code: 115
01:51:58.442  Up KEYCODE_VOLUME_UP - consumed: false, key code: 24, time since event: 86ms, device name: mtk-kpd, descriptor: f0d2e427e7a05eb6d316f5e14800c5ac7b6aee79, device id: 6, is external: false, meta state: 0, scan code: 115
01:51:58.579  Performed action Toggle(lens=BACK), input event type: DOWN_UP, key meta state: 0

To Reproduce
Steps to reproduce the behavior:

Upload a backup of your keymaps. (Follow the guide here.)[https://sds100.github.io/KeyMapper/user-guide/backup-restore]

@sds100 sds100 added the bug Something isn't working label Jul 13, 2021
@sds100 sds100 self-assigned this Jul 13, 2021
@sds100 sds100 changed the title Weird behaviour when constraint is changed during long press. long press trigger is triggered ignoring constraints Jul 14, 2021
@sds100 sds100 changed the title long press trigger is triggered ignoring constraints Weird behaviour when constraint is changed during long press. Jul 14, 2021
@sds100
Copy link
Collaborator Author

sds100 commented Jul 14, 2021

fixed

@sds100 sds100 closed this as completed Jul 14, 2021
sds100 added a commit that referenced this issue Jul 14, 2021
@sds100
Copy link
Collaborator Author

sds100 commented Jul 15, 2021

caused another bug.

Turn on flashlight, and then long press volume down. A unwanted imitated volume down keypress (volume will go down by 1) will be generated (if you release volume down before the second long press keymap is triggered)

key_maps_20210715-111643.zip
key_mapper_log_20210715-111509.txt

@sds100 sds100 reopened this Jul 15, 2021
sds100 added a commit that referenced this issue Jul 15, 2021
@sds100
Copy link
Collaborator Author

sds100 commented Jul 15, 2021

fixed

@sds100 sds100 closed this as completed Jul 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant