initscr();
cbreak();
noecho();
assert(OK==keypad(stdscr,TRUE));
mousemask(BUTTON1_PRESSED|BUTTON1_RELEASED,NULL));
assert(has_mouse());
assert(166==mouseinterval(1));
refresh();
for(;;){
int ch=wgetch(stdscr);
// Detect mouse event and print coordinates
}
endwin();
In terminal emulator (alacritty), mouse coordinates are reported normally after a click of the left button. However, if I systemctl start gpm
then run it in tty(vt), there is no response at all wherever mouse is clicked.
How can I make it work in tty(vt) as well?