Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

get char on screen

Tags:

c++

ncurses

I've looked through the NCurses function list, and I can't seem to find a function that returns the characters already printed on the screen. Is there an accessible value for the char stored in each character cell? If not, is there a similar function in the Windows terminal?

I want to use this to replace all the characters on the screen of a certain value (ex: all the a's) with a different character, or with new attributes.

like image 787
Elliot Hatch Avatar asked Oct 13 '25 07:10

Elliot Hatch


1 Answers

The function inch() gets the character and returns it as a chtype. Use winch() to get a character from a window other than stdscr.

like image 58
Elliot Hatch Avatar answered Oct 14 '25 20:10

Elliot Hatch