Page 1 of 1

Blinking Cursor

Posted: Tue Apr 28, 2009 11:05 am
by purage
Hi,

Quick question. I am working on a GUI and I would like (but not necessary) to provide the end-user with some sort of ACK that they have summoned the focus of an input area. I think the best way is to use a blinking cursor. I have not designed a multi-tasking environment and I am at a loss for ideals on how to implement this effect without it. I find it a bit overboard to implement multi-tasking to be used solely for a blinking cursor effect, so is there an alternative way to do it in a mono-tasking environment without locking up the rest of the code using a loop? I thought about using the PIT timer, but that thing is so unpredictable. On some systems it may run quicker/slower than others, so I would like to stay away from that unless there is a way to make it a constant value on any system. Thanks

Re: Blinking Cursor

Posted: Tue Apr 28, 2009 11:39 am
by JamesM
purage wrote:Hi,

Quick question. I am working on a GUI and I would like (but not necessary) to provide the end-user with some sort of ACK that they have summoned the focus of an input area. I think the best way is to use a blinking cursor. I have not designed a multi-tasking environment and I am at a loss for ideals on how to implement this effect without it. I find it a bit overboard to implement multi-tasking to be used solely for a blinking cursor effect, so is there an alternative way to do it in a mono-tasking environment without locking up the rest of the code using a loop? I thought about using the PIT timer, but that thing is so unpredictable. On some systems it may run quicker/slower than others, so I would like to stay away from that unless there is a way to make it a constant value on any system. Thanks
Hi,

You've got the wrong end of the stick there, the PIT timer runs at a constant rate of 1.1931MHz. It has an adjustable divisor register so that it can interrupt at any rate between 1.1931MHz and 18.2Hz. All you have to do is set up the divisor properly, and it will be the same on all boxen.

Cheers,

James

Re: Blinking Cursor

Posted: Tue Apr 28, 2009 1:06 pm
by purage
OK, I will give it a shot, thanks.

Re: Blinking Cursor

Posted: Tue Apr 28, 2009 4:08 pm
by Troy Martin
Question using the topic title: in VGA graphics modes, the text cursor disappears. Do I have to draw one myself or can I re-enable the standard one (since you can use the BIOS text routines in graphics modes.)

Re: Blinking Cursor

Posted: Tue Apr 28, 2009 5:39 pm
by Firestryke31
In text mode the cursor is handled by hardware. In graphics mode it would be difficult to know exactly where to put the cursor, so the hardware just doesn't bother. In other words, you have to draw the cursor yourself.