Blinking Cursor

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
purage
On Probation
Posts: 119
Joined: Wed Feb 11, 2009 1:04 am

Blinking Cursor

Post 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
User avatar
JamesM
Member
Member
Posts: 2935
Joined: Tue Jul 10, 2007 5:27 am
Location: York, United Kingdom
Contact:

Re: Blinking Cursor

Post 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
purage
On Probation
Posts: 119
Joined: Wed Feb 11, 2009 1:04 am

Re: Blinking Cursor

Post by purage »

OK, I will give it a shot, thanks.
User avatar
Troy Martin
Member
Member
Posts: 1686
Joined: Fri Apr 18, 2008 4:40 pm
Location: Langley, Vancouver, BC, Canada
Contact:

Re: Blinking Cursor

Post 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.)
Image
Image
Solar wrote:It keeps stunning me how friendly we - as a community - are towards people who start programming "their first OS" who don't even have a solid understanding of pointers, their compiler, or how a OS is structured.
I wish I could add more tex
User avatar
Firestryke31
Member
Member
Posts: 550
Joined: Sat Nov 29, 2008 1:07 pm
Location: Throw a dart at central Texas
Contact:

Re: Blinking Cursor

Post 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.
Owner of Fawkes Software.
Wierd Al wrote: You think your Commodore 64 is really neato,
What kind of chip you got in there, a Dorito?
Post Reply