bug-ncurses
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: mouse support


From: Thomas Dickey
Subject: Re: mouse support
Date: Mon, 14 Feb 2005 20:24:08 -0500 (EST)

On Tue, 15 Feb 2005, Andreas wrote:

why dont this work!?

        case KEY_MOUSE:
          if( getmouse( &event ) )
            {
              if(event.bstate == BUTTON1_PRESSED)
                {
                  // do stuff here
                }
              if(event.bstate == BUTTON2_PRESSED)
                {
                  // do stuff here
                }
            }
          break;

I have folowed this text to write the code
http://en.tldp.org/HOWTO/NCURSES-Programming-HOWTO/mouse.html

Assuming that mouse support is working for your terminal/configuration,
you have to call mousemask() to enable the mouse events.  I'd start by
verifying that the ncurses test program is working as expected.  If
you've compiled ncurses yourself, that's test/ncurses, menu item 'a'.
If you're using something precompiled, the sources from the test directory
can still be configured/compiled against the existing development libraries.

--
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net




reply via email to

[Prev in Thread] Current Thread [Next in Thread]