QB64.org Forum

Active Forums => QB64 Discussion => Topic started by: hanness on August 02, 2021, 12:57:51 pm

Title: Is it possible to hide a cursor in console output from a QB64 program?
Post by: hanness on August 02, 2021, 12:57:51 pm
I have a QB64 program that I have written that outputs text to a console window. I have a line that shows a user if they have paused execution of the program. At the end of that line, where the cursor moves to the next character position on the line, the cursor is displayed. In the screenshot below you can see that cursor where the large green arrow is pointing.

Does anyone know of a way that I can hide that or cause the cursor to not be displayed?

  [ This attachment cannot be displayed inline in 'Print Page' view ]  
Title: Re: Is it possible to hide a cursor in console output from a QB64 program?
Post by: loudar on August 02, 2021, 01:01:22 pm
Maybe with this? http://www.qb64.org/wiki/CSRLIN (http://www.qb64.org/wiki/CSRLIN)
Can't say if it'll work for console though.
Title: Re: Is it possible to hide a cursor in console output from a QB64 program?
Post by: visionmercer on August 02, 2021, 02:49:37 pm
Maybe this will work for you:
Code: QB64: [Select]
  1. Print Chr$(27) + "[?25l"; 'Turn off cursor
  2. Print "No cursor?"
  3. Print Chr$(27) + "[?25h"; 'Turn on cursor
  4.  

Otherwise it can be done with the Windows API:
https://docs.microsoft.com/en-us/windows/console/setconsolecursorinfo
But that is out of my league.
Title: Re: Is it possible to hide a cursor in console output from a QB64 program?
Post by: hanness on August 02, 2021, 07:28:56 pm
Thanks for the suggestions!

Unfortunately, neither of the 2 suggestions provided have helped. After some research, I'm not finding a way to change this via a command, but if I really wanted to press the issue I could open any command prompt, right-click the title bar, select defaults, go to the Terminal tab, and change the cursor colors and other properties here. Using a value of 0 for red, green, and blue would effectively make the cursor invisible on a black background.

For now, I'll simply live with it the way it is. It's not critical, just would have been nice to make the output look a little cleaner.

Note: I did see the note about using an API, but that's a bit beyond my level for the moment.

  [ This attachment cannot be displayed inline in 'Print Page' view ]