|
From: | Thomas Dickey |
Subject: | Re: under ncurses, mouse events come as escape codes |
Date: | Thu, 29 Sep 2005 17:30:44 -0400 (EDT) |
On Thu, 29 Sep 2005, Adam H. Peterson wrote:
Thomas Dickey wrote:On Thu, 29 Sep 2005, Adam H. Peterson wrote:I'm having difficulty reading mouse events under NCurses. Instead of receiving KEY_MOUSE from getch(), I'm getting escape codes. For example, this program:perhaps $TERM isn't set properly (even though gnome-terminal hardcodes "xterm" rather than "gnome" ;-). ncurses is looking for "xterm" embedded in the $TERM name, or kmous matching xterm's string in the corresponding terminfo description.I was wondering about that. I also tried it after "export TERM=gnome" and got the same results (and like I mentioned, I tried it in a bona fide XTerm as well).Is there a way I can check that this is the problem? (And if so, is there a fix?) If it's relevant, I'm running Gentoo Linux 2005.1, and I also get the same problem under Ubuntu Hoary.
hmm - looking closer, you also have to use the keypad() function, e.g., keypad(stdscr, TRUE); That's because wgetch() is supposed to return 8-bit values unless keypad() is set true. -- Thomas E. Dickey http://invisible-island.net ftp://invisible-island.net
[Prev in Thread] | Current Thread | [Next in Thread] |