Author Topic: Is it possible to hide a cursor in console output from a QB64 program?  (Read 2768 times)

0 Members and 1 Guest are viewing this topic.

Offline hanness

  • Forum Regular
  • Posts: 210
    • View Profile
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?

  [ You are not allowed to view this attachment ]  

Offline loudar

  • Newbie
  • Posts: 73
  • improve it bit by bit.
    • View Profile
Re: Is it possible to hide a cursor in console output from a QB64 program?
« Reply #1 on: August 02, 2021, 01:01:22 pm »
Maybe with this? http://www.qb64.org/wiki/CSRLIN
Can't say if it'll work for console though.
Check out what I do besides coding: http://loudar.myportfolio.com/

Offline visionmercer

  • Newbie
  • Posts: 8
    • View Profile
Re: Is it possible to hide a cursor in console output from a QB64 program?
« Reply #2 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.

Offline hanness

  • Forum Regular
  • Posts: 210
    • View Profile
Re: Is it possible to hide a cursor in console output from a QB64 program?
« Reply #3 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.

  [ You are not allowed to view this attachment ]