C - Curses, remove the blinking cursor from the game

Hi, I am doing a job in C on Unix, and the task is to create a simple pong game. The game now works for me, except for one annoying part, the cursor constantly blinks right behind the oar. How to disable this?

Here is a screenshot.

enter image description here

+6
source share
1 answer

If your terminal supports cursor invisibility, you can do this with the curs_set function:

 curs_set(0); 

If your terminal does not support its invisibility, curs_set will return ERR , and the only option would be to try to move the cursor to the least distracting place (in this case, just holding the cursor at the top of the ball should be appropriate).

+11
source

Source: https://habr.com/ru/post/956805/


All Articles