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

More cursor keys #933

Merged
merged 7 commits into from
Jul 3, 2024
Merged

More cursor keys #933

merged 7 commits into from
Jul 3, 2024

Conversation

devycarol
Copy link
Contributor

@devycarol devycarol commented Jun 30, 2024

This patch implements toolbar keys for the following previously-reserved codes:

  • Page up/down (just didn't have buttons)
  • Page start/end

It also adds a new pair: word left/right. These replace line start/end for the left/right long-clicks in the toolbar.

  • Full left/right is now under the word-movers, and page start/end is under the pagers
  • A more comprehensive config could be implemented later on, maybe allowing choice between repeat input or various cursor actions on those toolbar arrows.

To test these keys, you can replace your numpad layout with this D-pad prototype: dpad_toy.json. The "double-arrow" keys are repeatable the main keyboard.

Small issue
The word-move keys are based on emulated Ctrl+Left/Right arrows. Android handles this differently from PCs:

  • It skips through space-separated non-word characters like punctuations and emoji.
  • It doesn't advance the cursor past the first/final instance of a word character.
    • This is the more eyebrow-raising one, since you expect the cursor to continue moving until it reaches the end of a text box. Like with any other cursor-mover.
    • In this case, it will continue making the clicking sound when held since "it is possible to delete characters."
  • Also, the method they use says to avoid using it whenever possible. Something about "race conditions"—not that I know what that means…

Because I'm CooCoo bananas: I've made a rich-input implementation of "selection units" which is utilized for a word-delete slider in the upcoming more-delete-keys. That can be recycled into a non-keycode implementation of word left/right later on for non-primitive input, just as it'll be recycled for "select adjacent word" keys.


Split from #925
Progress on #357

@Helium314
Copy link
Owner

Sorry for creating merge conflicts here, though they should be pretty simple to solve (you don't even need to change the codes for word left/right)

@devycarol devycarol closed this Jul 1, 2024
@devycarol devycarol reopened this Jul 1, 2024
@devycarol devycarol marked this pull request as ready for review July 1, 2024 20:04
@devycarol
Copy link
Contributor Author

after a fair bit of hot-wiring, this is ready to go 🙃

@Helium314
Copy link
Owner

Not much time for review on my side though. May take up to 2 days until I can have a look.

@Helium314
Copy link
Owner

Code looks good, with exception for the changed key codes.
I'll play a liitle on device trying to find unexpected stuff.

@devycarol devycarol marked this pull request as draft July 3, 2024 20:24
@devycarol
Copy link
Contributor Author

devycarol commented Jul 3, 2024

somehow a bunch of other stuff i was working on got merged in, so I had to force-push it out :/

About the repeat interval, I do think at most 10 per second would be best for the more drastic movers.

@devycarol devycarol marked this pull request as ready for review July 3, 2024 20:37
@Helium314
Copy link
Owner

Helium314 commented Jul 3, 2024

No problem, there was only the keycode change to do
(sorry for introducing build error, for some reason - probably cache - the local build still worked)

@Helium314 Helium314 merged commit bcf2a52 into Helium314:main Jul 3, 2024
1 check failed
@devycarol devycarol deleted the more-cursor-keys branch July 6, 2024 04:34
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