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

Spacebar multitaps and line break #881

Closed
6 of 7 tasks
sphh opened this issue May 7, 2024 · 3 comments
Closed
6 of 7 tasks

Spacebar multitaps and line break #881

sphh opened this issue May 7, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@sphh
Copy link
Contributor

sphh commented May 7, 2024

Steps to reproduce

  1. Open a text input with a proportional font.
  2. Fill a line with enough characters, so that a , or . would still fit into the line, but a ? would break the line
  3. Tap the spacebar multiple times: When the line breaks, e.g. encountering the question mark, more taps on the spacebar does not select the next punctuation, but inserts a space.

Expected behavior

More taps should cycle through the punctuations.

Actual behavior

After the line breaks into the next line, more taps on the spacebar starts the multitap behaviour again.

version of the program

2.7.6

Android version

Android 8.1

Device

Unihertz Jelly

Other details

No response

Acknowledgements

  • I have written a short but informative title.
  • I have updated the app to the latest version.
  • I have searched the existing issues and this is a new one, NOT a duplicate or related to another open issue.
  • This is not a question or a discussion, in which case I should have gone to lemmy.ml/c/thumbkey
  • This is a single bug report, in case of multiple bugs I will open a separate issue for each one (they can always link to each other if related)
  • I have admitted that I am a clown by having checked this box, as I have not read these acknowledgements. 🤡
  • I have filled out all of the requested information in this form.
@sphh sphh added the bug Something isn't working label May 7, 2024
@dessalines
Copy link
Owner

I'm guessing it considers a newline a cursor move? https://github.com/dessalines/thumb-key/blob/main/app/src/main/java/com/dessalines/thumbkey/ui/components/keyboard/KeyboardKey.kt#L210

I'm not sure what the best way to get around that would be.

@sphh
Copy link
Contributor Author

sphh commented May 7, 2024

I have absolutely no idea, since I am neither an Android nor a Java developer. I just know, that this works as expected with The Other App …

@glm4610
Copy link
Contributor

glm4610 commented May 22, 2024

I'm guessing it considers a newline a cursor move?

Yes, the way it is implemented, it actually compares the on-screen cursor coordinates to check if it moved. So any vertical movement is considered a move

I'm not sure what the best way to get around that would be.

I've managed to get a working reimplementation which actually takes the cursor's index into account. I'll create a pull request for it soon.

On another note, I think it would be beneficial to redesign the way ReplaceLastText actions work, as they seem quite imperative currently (as they depend on a hard coded trim length). This redesign could provide new interesting action possibilities, and it might fix some of the problems we have with multitaps on some apps too

glm4610 added a commit to glm4610/thumb-key that referenced this issue May 22, 2024
This adds a new function to the IMEService class which makes it ignore
the next cursor movement
glm4610 added a commit to glm4610/thumb-key that referenced this issue May 22, 2024
This adds a new function to the IMEService class which makes it ignore
the next cursor movement. This function is called from certain parts in
`performKeyAction` which would interfere with the cursor movement detection algorithm
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

3 participants