CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

Ansi escape code to hide the cursor

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
MarcosAmbrose



Joined: 25 Sep 2006
Posts: 38
Location: Adelaide, Australia

View user's profile Send private message

Ansi escape code to hide the cursor
PostPosted: Tue Oct 28, 2008 11:05 pm     Reply with quote

I'm trying to send an ANSI escape sequence to hide the cursor on my terminal so you don't see it dancing around the screen, but I just can't seem to get it to work. My other ANSI related functions seem to work ok. Anyone got any ideas? I've googled this one to death with no success.

Code:

#define ON 1
#define OFF 0

void main()
{
   ClrScr();
   Cursor(OFF);

   while(1)
   {
      printf("Print some stuff\r");
   }
}


//// Clear the terminal screen ///
void ClrScr(void)
{
   printf("\x1B[2J");
}


//TURN THE CURSOR ON/OFF ///
void Cursor(int1 IO)
{
   if(IO)
   {
      printf("\x1B[?25h");
   }
   else
   {
      printf("\x1B[?25l");
   }
}
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group