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

Autorepeat gets stuck when pressing two arrows or arrow+DEL/BKSP at the same time on extra keys bar #2156

Open
rsola opened this issue Jul 3, 2021 · 4 comments

Comments

@rsola
Copy link

rsola commented Jul 3, 2021

Hi. I have been using Termux for a long time and I find it very useful, but a few annoying issues surface from time to time. Some of them are easy to reproduce in order to avoid as much as possible the circumstances which trigger them. Some other issues are harder to track down.

Problem description

Suppose you have the default extra keys bar with the four arrow keys, or you customized it via termux.properties. Arrows, DEL and BKSP have autorepeat behavior, so they are sent continuously as long as you hold them. When two of these keys are tapped at the same time, autorepeat gets stuck.

Steps to reproduce

To make the problem more obvious, open a full screen editor with some text loaded. Then, tap (no need to hold or keep tapping) any two arrows or an arrow and DEL or BKSP at the same time on the extra keys bar. It may also work with DEL and BKSP if you have included them both on your extra keys settings.

For example, you are editing a file. A few consecutive lines have a comment character at the beginning and you want to remove it from all these lines (suppose your editor doesn't have a macro feature). Then, you repeatedly tap DEL and DOWN in rapid succession, which will trigger this issue. Cursor moves like crazy, history lines are recalled or characters are being deleted at great speed. There is just a little you can do to stop this madness. Ctrl and Alt extra keys cannot be used because they get cancelled whenever a key is sent to the terminal.

Workaround: long tap on screen so selection handles and the copy/paste/more menu appear. Then, autorepeat stops. However, a ghost handle or menu could remain on screen when dismissed.

Expected behavior

Autorepeat mode must not get stuck, i.e., maybe simultaneous key presses with autorepeat should be processed serially.

Additional information

  • Termux application version: 0.114
  • Android OS version: 8.1
  • Device model: Samsung SM-J710F (Galaxy J7 from 2016)
@rsola rsola changed the title Autorepeat gets stuck when pressing teo arrows Autorepeat gets stuck when pressing two arrows or arrow+DEL/BKSP at the same time on extra keys bar Jul 3, 2021
@creepy-pasta101
Copy link

I can confirm this on latest debug artifact....
But strangely... It stops after opening the context menu...

Record_2021-07-03-17-30-20.mp4

@rsola
Copy link
Author

rsola commented Jul 3, 2021

Yes, sorry, I pressed Submit accidentally before I wrote the full text.

Oh, and thanks for the repro.

@agnostic-apollo
Copy link
Member

Confirmed. AutoRepeat is implemented here. Will look into it. Other stuff needs to be done for extra keys too, so might do it with it at some point.

@agnostic-apollo
Copy link
Member

It's likely because previous executioner should be shutdown before starting a new one and losing reference to the old one. Just a guess. But if there is a need to press multiple keys at the same time, which likely there is, then will have to create a list of executioners.

ghost pushed a commit that referenced this issue Jul 11, 2021
Under certain cases scheduled executor may leak causing repeatable input to
stuck.

Issue: #2156
AdamMickiewich pushed a commit to VolyaTeam/dzida-app that referenced this issue Aug 8, 2022
Under certain cases scheduled executor may leak causing repeatable input to
stuck.

Issue: termux#2156
shrihankp pushed a commit to reisxd/termux-app that referenced this issue Oct 20, 2022
Under certain cases scheduled executor may leak causing repeatable input to
stuck.

Issue: termux#2156
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

No branches or pull requests

3 participants