Source Code File 14-01_mousetest
14-01_mousetest.c
#include <ncurses.h>
int main()
{
initscr();
if( NCURSES_MOUSE_VERSION>0)
{
addstr("Mouse functions available.\n");
mousemask(ALL_MOUSE_EVENTS,NULL);
addstr("Mouse Active");
}
else
{
addstr("Mouse functions unavailable.\n");
}
refresh();
getch();
endwin();
return 0;
}
Output Screenshot

Notes
* Remember, even when mouse functions are available, you must ensure that the terminal can capture mouse input. The operating system may prioritize mouse clicks, stealing them from your program.
* Extra characters that may appear after the program runs are generated by the mouse click, but unused by the program.
Copyright © 1997-2025 by QPBC.
All rights reserved
