-
Notifications
You must be signed in to change notification settings - Fork 36
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
Expose methods for performing raw print request #91
Comments
Can you give a little more context on what you're trying to do? Maybe we can come up with a solution that doesn't require you to deal with raw printing. |
I'm building a chat client where I provide auto completion when typing commands so I'm capturing the keyboard input directly and is therefore managing the input field the cursor position in my code.
Today using
So essentially
I suppose I could hide the cursor and draw my own cursor. Another issue had with the Animation class was that it was always inserting a new line at the end which causes issues when you try draw something which covers the whole screen. |
I just released a new version that adds a |
Cool, I'll try it out! |
So tried it out and it kinda works with some issues:
|
I decided that there isn't any reasonable way for Animation to work out of the box if the cursor is moved while it's running, so I went ahead and exposed the I also added an option to omit the trailing line break from Animation if you still want to use it. It's kind of an odd option; i'd rather just never have a trailing line break, but without one you wouldn't be able to have multiple animations running at the same time. |
Problem
I'm implementing a full screen interactive tool which needs to manipulate the cursor position. My first attempt was using the animation feature to update the screen but I realised it doesn't fit my purpose because it is build to be rendered inline with other widgets by hooking into the print requests, which makes it not compatible with manipulating the cursor.
Ok, since my use case is much simpler than what Animation attempts to do I decided draw my animation on my own. Unfortunately this was not possible without changes the Mordant library since I need to send raw print requests to refresh the screen.
Suggestion
Expose sending raw print requests:
The text was updated successfully, but these errors were encountered: