Originally Posted by
john.c
Are you using ncurses itself or are you using pdcurses?
i use ncursesw from Msys2
Did you download a precompiled library or compile it yourself?
I use no library
Are you compiling your program through mingw or msys2, or just directly on Windows?
i use msys2 mingw64 gcc
You mentioned Linux, too. Have you also tried it on Linux?
i tried on virtual box with a Debian 13. On Linux the program works fine because the OS sees mouse as USB Tablet pointing device.
Post the shortest program that demonstrates the problem.
Code:
#include <ncurses.h>
int main() {
initscr(); // Initialize ncurses
cbreak(); // Line buffering disabled, Pass on everything to me
noecho(); // Don't echo() while we do getch
keypad(stdscr, TRUE); // Enable keypad mode
mousemask(ALL_MOUSE_EVENTS, NULL); // Enable mouse events
// Check if the terminal supports mouse
if (!has_mouse())
{
endwin(); // Clean up ncurses
printf("Mouse not supported.\n");
return 1;
}
mvprintw(LINES / 2, (COLS - 21) / 2, "Click anywhere to exit");
refresh();
int ch;
MEVENT event;
while((ch = getch()) != KEY_F(1)) { // Exit loop on pressing F1
if(ch == KEY_MOUSE) {
if(getmouse(&event) == OK) {
if(event.bstate & BUTTON1_CLICKED) {
// Left button clicked
break;
}
}
}
}
endwin(); // Cleanup ncurses
return 0;
}
Something else, chatgpt mentions that ncurses for win or linux has no native support for touchpad devices