bwkaz
12-09-2001, 07:31 PM
OK, I've been trying to make a console Minesweeper with ncurses (I have v5.2) and, well, that's about it. Basically, the problem I have is that I set up the console for ncurses, and then enable mouse events for buttons 1, 2, and 3 (just the clicked event, not presses/releases), and then sit in a loop and getch() until it returns 'q' (oh yeah, I'm doing it in C). So far, so good. From my understanding, the getch() should return KEY_MOUSE when a mouse event that you have unmasked happens. Then I should call get_mouse() to get the info (x, y, button state, and device number).
Originally, I had no mouse clicks coming through at all on the straight console, but I had left-button only in an xterm (well, a KDE Konsole window, actually). I have since recompiled ncurses and enabled GPM support, and now the console version does get all three buttons. But the Konsole window version still only gets button 1. The right button pops up a KDE shortcut menu, and the middle button does nothing.
Anyone seen this before? Anyone know where to look for a solution? Or should I just hack on the Konsole source code for a while and see if I can get it to pass along something other than button 1?
Oh, my $TERM is set to "linux" on the console, and "xterm" in KDE. The terminfo for both of them has the correct mouse event escape code ("\E[M") set. The "xterm" file in /usr/share/terminfo is actually a symlink to xterm-xf86-v40, as I am running X 4.1.0. Is this set right? I can't find an entry for Konsole anywhere in the terminfo database.
Thanks to all in advance.
Originally, I had no mouse clicks coming through at all on the straight console, but I had left-button only in an xterm (well, a KDE Konsole window, actually). I have since recompiled ncurses and enabled GPM support, and now the console version does get all three buttons. But the Konsole window version still only gets button 1. The right button pops up a KDE shortcut menu, and the middle button does nothing.
Anyone seen this before? Anyone know where to look for a solution? Or should I just hack on the Konsole source code for a while and see if I can get it to pass along something other than button 1?
Oh, my $TERM is set to "linux" on the console, and "xterm" in KDE. The terminfo for both of them has the correct mouse event escape code ("\E[M") set. The "xterm" file in /usr/share/terminfo is actually a symlink to xterm-xf86-v40, as I am running X 4.1.0. Is this set right? I can't find an entry for Konsole anywhere in the terminfo database.
Thanks to all in advance.