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

Supports moving the cursor when inputing in search menus #766

Open
dyphire opened this issue Nov 4, 2023 · 4 comments
Open

Supports moving the cursor when inputing in search menus #766

dyphire opened this issue Nov 4, 2023 · 4 comments

Comments

@dyphire
Copy link
Contributor

dyphire commented Nov 4, 2023

When using search menus, it should supports moving the cursor during input, achieving more flexible input operations. This is very useful for subtitle downloads.

Refer to the code already implemented in the console script.

@dyphire dyphire changed the title Support for moving cursor during input Supports moving the cursor when inputing in search menus Nov 4, 2023
@po5
Copy link
Contributor

po5 commented Nov 4, 2023

The console's text input doesn't scroll when text is larger than the screen. This related to why search text in uosc is right-aligned, because it's the only way we can efficiently cut off excess text in ASS without obscuring what's being typed.
The ability to move the cursor implies the ability to scroll through text that overflows, and there's no good way to do that.

@dyphire
Copy link
Contributor Author

dyphire commented Nov 4, 2023

The console's text input doesn't scroll when text is larger than the screen. This related to why search text in uosc is right-aligned, because it's the only way we can efficiently cut off excess text in ASS without obscuring what's being typed. The ability to move the cursor implies the ability to scroll through text that overflows, and there's no good way to do that.

I am not aware of the limitation of overflow text here, which is indeed a problem.

@po5
Copy link
Contributor

po5 commented Nov 4, 2023

Thinking about it more, we can once again leverage the fact our text is right-aligned. It will cost us one text estimation call to get the width of text to the right of our desired cursor. Haven't thought enough about implementation details, but having this value and the width of the menu should be enough to know whether to offset the text and by how much.

@tomasklaen
Copy link
Owner

As @po5 described, this is not trivial to implement in this environment.

Refer to the code already implemented in the console script.

As mentioned, console doesn't handle overflow and it breaks when text gets wider than input field. This is important for us to handle as our inputs are not that wide.

Thinking about it more...

Yeah, it is doable, but really annoying to implement and handle scrolling and stuff, and since it's not that important and the input is pretty usable even without it, none took a stab at it yet.

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