Skip to content

Conversation

@mehalter
Copy link
Contributor

Added basic functionality for users to adjust keyboard delay. What is the 200 delay on line 261 represent? Is this another value that should be adjusted? I couldn't tell exactly what was happening there with my basic understanding of the codebase currently

@xiongyihui
Copy link
Contributor

The 200 ms delay is used to distinguish between Tap-key and fast typing. If we type D (a Tap-key) andU fast, U is pressed before D is released, and D is released before Uis released.

  • When dt1 < 500 and dt1 > 200, consider it as fast typing
  • When dt1 < 500 and dt2 > 200, use it as a composite key
     D down    U down   D up     U up
      |         |        ^        ^
      v         v        |        |
------+---------+--------+--------+---------> t

      <--------> <------>
         dt1       dt2

200 is a threshold of dt2. Maybe we should set the threshold based on dt1.

By the way, I was thinking to change is_tapped to is_tap_key. How do you think?

@mehalter
Copy link
Contributor Author

Ok that makes sense. I made that an adjustable property as well. I thought abotu a good way to make it dependent on dt1, but I think people will like to be able to tweak each value individually.

Also I like the name change to is_tap_key I think it makes it more clear what it is checking. I made this change as well.

@xiongyihui xiongyihui merged commit 8d184d9 into makerdiary:main Sep 10, 2020
@xiongyihui
Copy link
Contributor

Thanks. Merged.

@mehalter mehalter mentioned this pull request Sep 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants