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

release-key should send a release event even if no keys are in the keyberon state #195

Closed
gerhard-h opened this issue Nov 22, 2022 · 4 comments
Labels
bug Something isn't working

Comments

@gerhard-h
Copy link
Contributor

latest build on windows

  ram (multi
        (release-key lctl)
        (release-key lsft)
        (release-key lmet)
        (release-key lalt)
	(release-key rctl)
        (release-key rsft)
        (release-key rmet)
        (release-key ralt)
      )

I thought this would release all modifiers but all that happend is:

09:42:42 [DEBUG] (1) kanata::kanata::windows::llhook: event loop: KeyEvent { code: KEY_RIGHTBRACE, value: Press }
09:42:42 [DEBUG] (1) kanata::kanata::windows::llhook: event loop: KeyEvent { code: KEY_RIGHTBRACE, value: Release }
and it also didn't fix my stuck keys

KEY_RIGHTBRACE is the key I mapped @ram to

(macro 100 lctl 100 lsft 100 lmet 100 lalt 100 rctl 100 rsft 100 rmet 100 ralt ) is maybe the simpler approach anyway

@jtroo jtroo added the bug Something isn't working label Nov 22, 2022
@jtroo
Copy link
Owner

jtroo commented Nov 22, 2022

My guess is that this is the issue:
The way the release-key action works right now is that it manipulates the internal keyberon state but doesn't send any events. And then other code mechanisms will detect this change in state and send a key release. But this relies on that state being there in the first place, so if e.g. the keys are unmapped, and not processed by kanata, a release wouldn't be sent.

I don't think there's any harm in sending a release-key event alongside manipulating the internal state, so that's a potential fix.

@jtroo jtroo added the selected label Nov 24, 2022
@gerhard-h
Copy link
Contributor Author

I tried this (macro 100 lctl 100 lsft 100 lmet 100 lalt 100 rctl 100 rsft 100 rmet 100 ralt ) release all key but it didn't work either.

  • then I quit kanata but the keys where still stuck
  • then I ran a ahk script. that should release all these keys but it didn't do it either
  • finally I pressed the pysical key and the key was released

I just wonder what's the reason, the key does not get released by software? (also I'm not able to reproduce the error)

@jtroo
Copy link
Owner

jtroo commented Nov 26, 2022

Seems like it's a rare issue that others have encountered. I've seen someone say it's happened to them when using only AHK; they aren't a kanata user.

So seems like the issue you were originally trying to solve is the same as #188, and it also seems like it might be some lower-level Windows issue related to the keyboard hook and/or SendInput.

I'll probably still add the release-key change, even though it doesn't solve the underlying problem.

@jtroo jtroo added help wanted Extra attention is needed blocked Blocked on issues outside of the reasonable control of the kanata project and removed help wanted Extra attention is needed blocked Blocked on issues outside of the reasonable control of the kanata project labels Nov 26, 2022
@jtroo jtroo changed the title multi release-key does nothing release-key should send a release event even if no keys are in the keyberon state Nov 28, 2022
@jtroo
Copy link
Owner

jtroo commented Dec 7, 2022

I had forgotten that release-key was not implemented as a Custom action but rather as a part of the normal keyberon actions, so making the change I proposed is non-trivial and seems like it would have minimal benefit since it doesn't solve any problems.

I'll close this one for now, for lack of a known useful use case.

@jtroo jtroo closed this as not planned Won't fix, can't repro, duplicate, stale Dec 7, 2022
@jtroo jtroo removed the selected label Dec 7, 2022
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

2 participants