Page 1 of 1

Providing a Driver for printing to screen

Posted: Tue May 03, 2005 11:20 pm
by Warrior
I'm attempting to write a video driver but want to know how I would go about doing certain things.


- Should the user be able to scroll up the screen and see previous text?

- Should the user be able to type behind is starting point? (if they scroll back)

I was thinking store the X/Y values of the users starting point when they first print text and reset it everytime enter is pressed. I don't want my users overwriting information the kernel has printed but I want to maintain the ability to scroll back.

As for scrolling up after the text is gone, I figured once the maximum Y has been reached on the screen, store everything that's currently on the screen somewhere. Question is how will I know if the user has scrolled up past the new starting point so I can store that and rewrite the old?

I guess my aims are to have an console enviroment where the user can see whats happened if it happens as a rapid rate (as it sometimes does in linux =P and iirc you can't scroll up)

Any comments are welcome.

Regards,
Warrior

Re:Providing a Driver for printing to screen

Posted: Tue May 03, 2005 11:59 pm
by Pype.Clicker
you can certainly scroll up in most linux consoles. The only thing is that the "scrollup" is limited to a certain amount of line ... and that framebuffered consoles may lose the "content of what's scrolled up" when you switch to X.

about "continueing to type" while scrolling, most common approach is to jump back to the current write position when typing (which i found myself highly irritating). I'd instead suggest you _split_ the output in that case, higher half showing what's being scrolled and lower part what's being typed.

Re:Providing a Driver for printing to screen

Posted: Wed May 04, 2005 12:01 am
by Warrior
Ah, don't know much about linux, made a guess from the little times I've used it.

That's a pretty good idea, thanks.

Re:Providing a Driver for printing to screen

Posted: Fri May 06, 2005 3:15 pm
by Warrior
*bump*

Any ideas on how to stop a user from overwriting important messages? Possibly only go back as far as he typed?

Re:Providing a Driver for printing to screen

Posted: Fri May 06, 2005 9:49 pm
by AR
What are you talking about exactly? No, the user should not be able to type behind the prompt as it would be pointless since nothing is going to read the input.

Re:Providing a Driver for printing to screen

Posted: Sat May 07, 2005 2:56 am
by Pype.Clicker
Warrior wrote: Any ideas on how to stop a user from overwriting important messages?
uh ? could you detail how you imagine that could occur ? honestly, i don't get wwhat you mean ...

Re:Providing a Driver for printing to screen

Posted: Sat May 07, 2005 9:33 am
by Warrior
Well my driver allows users to go backwards in thier position on the screen (for backspace) but they can overwrite messages that the kernel posted (error/success messages, status messages, etc..) I was just asking for thoughts on an effective way to stop this. The only thing that comes to mind is to save all text somewhere with an additional attribute (R/W) or another thought might be to only allow the user to backspace as much as he typed.

Re:Providing a Driver for printing to screen

Posted: Sat May 07, 2005 10:28 am
by AR
You would probably want to record the XY coordinates that the prompt started at and ignore attempts to backspace behind that point.

Re:Providing a Driver for printing to screen

Posted: Sat May 07, 2005 11:30 am
by Warrior
Yep, that seems the cleanest way to do it was just wondering if others did it differently. Thanks!

Re:Providing a Driver for printing to screen

Posted: Mon May 09, 2005 1:29 am
by bubach
AR wrote: You would probably want to record the XY coordinates that the prompt started at and ignore attempts to backspace behind that point.
The X and Y coordinates of the prompt can change if for example the typed command makes the screen scroll.
Keep track of the position in the input buffer and then check so that the buffer pointer is > 0 before doing the actuall backspace.

/ Christoffer