qx82 icon indicating copy to clipboard operation
qx82 copied to clipboard

readLine printed over several lines

Open GuillermoDylan opened this issue 1 year ago • 4 comments

Would there be a way to make the method qxa.readLine() show the typed text over several lines instead of overflowing on the screen?

My initial thought was that the maxLen parameter would do something like that, but it seems to do nothing when used.

GuillermoDylan avatar Jan 25 '24 23:01 GuillermoDylan

You mean for multi-line input where the user can press ENTER and continue typing? Or just input a very long line that wraps around?

One problem is that qxa.readLine() doesn't support true editing, only backspacing, and if the text flowed to a new line people would probably expect the arrow keys and other editing keys to work.

Maybe what I should have is more of a text-area "widget" where users could edit text, but that would be a substantial undertaking.

In the meantime, making it so qxa.readLine() wraps around might be feasible, I'll look into it.

btco avatar Jan 29 '24 17:01 btco

Yea I mean just wrapping a very lo g line could be cool, I tried editing the code for a small project I made and adding a line break ('\n') after x characters seemed to work fine (not for very long inputs I guess tho).

The text area sounds cool but maybe too much for small texts in mu opinion, but maybe I'm just imagining how it would work differently.

GuillermoDylan avatar Jan 29 '24 19:01 GuillermoDylan

Makes sense, I'll think about it!

btco avatar Feb 07 '24 04:02 btco

~~Here is a quick-and-dirty version of readLine I whipped up, no idea if it's what you're looking for or any good: let a = await qxa.readLine("", 10) and it will restrict the length of each line to 10.~~

EDIT: Created a PR for this instead, with better logic and understanding of what maxLen is

HoofedEar avatar May 15 '24 23:05 HoofedEar