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

Occasionally does not register that you are holding a key down when detecting chatter. #12

Open
ossf3 opened this issue Feb 12, 2021 · 8 comments
Labels
bug Something isn't working enhancement New feature or request

Comments

@ossf3
Copy link

ossf3 commented Feb 12, 2021

When using the program in games if a movement key (wasd) is detected as chatter and you are holding it down it causes the key to not register as being held down. This seems to only be a problem for games as it does not happen when holding keys down in a text box such as notepad.

@mcmonkey4eva
Copy link
Member

This is a difficult problem to solve.

Fundamentally, what currently happens is:

  • You physically press the key
  • The key-pressed-down signal is sent to Windows
  • KeyboardChatterBlocker sees the press and allows it through
  • The key physically chatters (goes back up and then back down inside the switch)
  • The key-released signal is sent to Windows (from the chatter)
  • KeyboardChatterBlocker sees the release and allows it through
  • The key-pressed-down signal is sent to Window (from the chatter)
  • KeyboardChatterBlocker sees that this press came very quickly after the previous keypress, and as such denies it
  • You eventually physically release the key
  • The key-released signal is sent to Windows
  • KeyboardChatterBlocker sees that this was the release from a denied press, and so denies the release as well

So, in short: Press (Allowed), Release (Allowed), Press (Denied), Release (Denied)
What you need to happen would be: Press (Allowed), Release (Denied), Press (Denied), Release (Allowed)


There would be two theoretically ways to go about this:
1: Somehow physically identify which actions are related to chatter and which aren't - which is basically impossible, the only reliable detection is by timing, keyboards just don't send enough meta-detail to the OS
2: Reversing the denial logic, such that rapid releases get denied, rather than rapid presses.

That '2' is an interesting option, and at first thought would work... but would then bring up a new problem: ... most key-releases are rapid. This would block a majority of key releases while typing - which would necessitate a followup solution: there'd have to be some form of auto-release logic that waits a specified time, and if the key wasn't re-pressed, sends a (fake) key release*. This has a lot of potential for side effects... including, of course, any buttons in a game that change behavior depending on how long it's pressed (eg if the timer is set to 100ms, and you press W, you can never move forward less than 100ms of movement at a time, which would could be disruptive when you need precision).

* I'm not sure if a fake key-release can be done in a reliable way. It can't at all using normally available methods, though the 'Interceptor' library claims to be able to control lower level signalling like that.


The current standing "good enough" workaround is using the Auto-Disable Programs tab as explained here: #11 (comment)

This simply disables the chatter block automatically when you have a game open... it's far from perfect, as obviously there are inputs inside a game that would need chatter blocked still (in-game chat boxes, or special abilities that would get double-activiated, ...) but generally works out well enough - or at least, makes sure you're no worse off than you were without KeyboardChatterBlocker running, lol.

@mcmonkey4eva mcmonkey4eva added bug Something isn't working enhancement New feature or request labels Apr 2, 2021
@NickatelbNornkirn
Copy link

This happened to me. My current workaround is disabling this program when gaming (where key chatters usually don't matter).

@ahparhizgar
Copy link

ahparhizgar commented Apr 28, 2022

a third way may be delaying first release for a (usually short) period of time to see if a press occurs. if press occurs simply ignore both release and press. and if it didn't happen, register that release.
the delay may not be a good thing for gaming though.

1: Somehow physically identify which actions are related to chatter and which aren't - which is basically impossible, the only reliable detection is by timing, keyboards just don't send enough meta-detail to the OS
2: Reversing the denial logic, such that rapid releases get denied, rather than rapid presses.

@mcmonkey4eva
Copy link
Member

There isn't a way to delay a release (actually forcing the thread to wait would also delay any followup presses/releases as well), other than to block it and then fake it after, which has the same * problem in my post above.

@SevaOnOsu
Copy link

having this same problem with measure_from: Release. I might be pressing the key too fast sometimes, even though my threshold is set to 30ms. 125hz keyboard might also be a factor. I think this might be fixed if the program checks if key is held down after the threshold, and if it is, presses the key down.

@xpader
Copy link

xpader commented Jul 6, 2023

Looks like it's a difficult to solve.

Current soloution is fast to release a key, but can‘t handle long press when there is chatter happend.

Steps:

  • Press a key
  • KeyboardChatterBlocker let it pass
  • Chatter, key release happend
  • KeyboardChatterBlocker let release pass (This is not I want)
  • Chatter, key press happend (This is not I want)
  • KeyboardChatterBlocker denied it.
  • (now the key status is released)
  • After a while, I released the key
  • Cause current status is released, release is denied.

The disadvantage of current soloution makes long press to a short single press, the advantage is real short single press is very fast.

Another solution steps:

  • Press a key
  • KeyboardChatterBlocker check this key doesn't have a timer, let it pass, and set a timer, and record current status is pressed for this key
  • Chatter, key release happend
  • KeyboardChatterBlocker check this key has a timer, denied, and record last status (not current) is release for this key
  • Chatter, key press happend
  • KeyboardChatterBlocker check this key has a timer, denied, and record last status (not current) is press for this key
  • (now the key current status is pressed, last status is pressd)
  • After a while timer is ended, check if the key current status == last status, do nothing, else send last status event

Two keypoint:

  1. KeyboardChatterBlocker check does this key has a timer, if not let them pass, set a timer for this key, record current status, else denied it, record last status.
  2. When timer is time up, check if the key current status == last status, do nothing, else send last status event.

The disadvantage of this soloution is most short single key release will have a delay in timer, and not just do pass or denied, it need delay to send key action, I don't know if this is easy to implement, but the advantage is long press and short press will work normally.

@Hebelios
Copy link

I am reviving this thread because it's a similar issue.
my left-shift chatters - so when I intentionally hold it down and it chitters during the press, it will interrupt and ignore the continued button press.

this makes the use of shift in conjunction with other keys incredibly difficult.
Maybe a solution can be found?

maybe a toggle-able option to ignore release when an immediate chatter-press is registered for certain keys?

@mcmonkey4eva
Copy link
Member

mcmonkey4eva commented Oct 25, 2024

For shift, maybe just disable the chatter block? under Configure Keys add your shift key and set the chatter delay to 0.

It will allow chatter through, which registers multiple key strokes, but in most contexts that's fine, as shift on its own usually doesn't do anything, it's just a held-or-not state usually, ie it's fine to leave chatter through to allow the held state to be accurate

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

7 participants