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

Shift doesn't work when writing fast #227

Closed
Glitchy-Tozier opened this issue Jan 23, 2021 · 10 comments · Fixed by #1832
Closed

Shift doesn't work when writing fast #227

Glitchy-Tozier opened this issue Jan 23, 2021 · 10 comments · Fixed by #1832
Labels
area: kbd-logic Issues with the keyboard backend (logic, crashes, etc.) bug A bug report bug-confirmed A confirmed and reproducible bug report
Milestone

Comments

@Glitchy-Tozier
Copy link
Collaborator

Glitchy-Tozier commented Jan 23, 2021

Environment information

  • FlorisBoard Version: 0.3.4
  • Install Source: Google PlayStore
  • Device: Samsung Galaxy S9
  • Android version, ROM: One-UI 2,5, Adroid 10

Steps to reproduce

  1. Quickly type any key and then shift
  2. Shift won't be activated in some cases

(Mainly happens to me with delete&space → shift, but it can also happen with letters and enter)

@Glitchy-Tozier Glitchy-Tozier added the bug A bug report label Jan 23, 2021
@patrickgold
Copy link
Member

Thanks for the report! This has something to do with my effort to cancel out invalid double-press actions I introduced in v0.3.4. I will look into it.

@Glitchy-Tozier
Copy link
Collaborator Author

Almost suspected that. I couldn't find the old bug however

@patrickgold
Copy link
Member

Relevant issue for double-press bug: #170

@patrickgold patrickgold added the bug-confirmed A confirmed and reproducible bug report label Jan 23, 2021
@patrickgold patrickgold added this to the 0.4.0 milestone Jan 23, 2021
@patrickgold patrickgold added the area: kbd-logic Issues with the keyboard backend (logic, crashes, etc.) label May 23, 2021
@patrickgold
Copy link
Member

This bug really annoys me: all the great work of #1822 with reworking and fixing soo much and this little bug here continues to survive all my extermination attempts. The main problem is that the shift key is the only key to do its thing on down instead of up, which messes up the order if shift follows another key immediately.

@Glitchy-Tozier
Copy link
Collaborator Author

Glitchy-Tozier commented Apr 29, 2022

One thing that might help you when testing is that speed does not even play a role.

  1. Letter key-down
  2. Shift key-down
  3. Letter key-up
  4. Shift key-up (the only speed-constraint is that you need to release shift before long-tap triggers caps-lock)

Edit: Why does the shift-key need to get activated on key-down?

@patrickgold
Copy link
Member

patrickgold commented May 8, 2022

One thing that might help you when testing is that speed does not even play a role.

Thanks for the hint, that's true and I also noticed that today while working on another shift issue. I still have vast problems with fixing this issue though, because I have an idea for a fix but it somehow causes keys to suddenly be eaten if shift+character is pressed at once, which is sub-optimal xD I just made the horrific discovery that this key-gets-eaten thing I discovered while experimenting is not specific to the shift key, but any time the layout gets re-composed due to a state change.

You can even try it out in the latest beta: Make sure the keyboard is normally shifted (either manually or auto-capitalization). Then press two character keys at once. Only one gets printed. If you press two character keys without a shift change, both get printed correctly. This is a really spicy bug now xD

Edit: Why does the shift-key need to get activated on key-down?

Because else the UI does not update quickly enough and due to the fact that with the latest progress in #1832 you can now hold shift and type uppercase only while pressed, then it goes back to lowercase (like the real shift key on PC). This needs caps lock on shift long press to be disabled though in the prefs, else you end up with caps lock after releasing your finger.

@patrickgold
Copy link
Member

Above two commits should™ fix the issue. I tested this quite a lot, with fast typing, slow typing, pressing shift and a key at once in different apps and in different order/speed and it never ignored the shift.

This fix will be released in 0.3.16-beta02. Issue will auto-close when linked PR is merged, we can re-open if really necessary after IRL testing after the beta release. Thanks again for reporting!

@Glitchy-Tozier
Copy link
Collaborator Author

  1. How did you fix the issues? :)
  2. Should we close this issue, then?

@patrickgold
Copy link
Member

  1. How did you fix the issues? :)

By adding a computedDataOnDown and comparing this to the current computedData when releasing the key. This way I can correctly send the up key and cancel the down if it changed while the finger was down. Also the shift up logic now checks that no key is pressed and that it is not an uninterrupted event before resetting the shift state.

  1. Should we close this issue, then?

No, this issue is attached to #1832 and will close itself when I merge it in.

@Glitchy-Tozier
Copy link
Collaborator Author

  1. I see
  2. Got it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: kbd-logic Issues with the keyboard backend (logic, crashes, etc.) bug A bug report bug-confirmed A confirmed and reproducible bug report
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants