ncursespdcurses

Retrieve character in windows buffer


I would like to be able to get the character in the buffer windows. Like the contrary of waddstr ?

int main(void)
{
    initscr();
    
    printw("LINES = %d\n", LINES);

    // Now y=0 / x=0 contain 'L'.
    // How can I retrieve it from the windows buffer ? 
    // Like I didn't do the printw and I don't know what have been print into the windows buffer. 
    
    refresh();
    
    // Same question
    
    getch();
    
    endwin();
    return 0;
}

Is it impossible or am I missing something very obvious ?


Solution

  • It sounds like you're looking for the inch() family of functions. See also inchstr() and instr().