title: Mouse movement events in NCurses
body: <p>I wonder if there is such a thing as mouse movement events in NCurses, and if there is a way to catch them. Following the <a href="http://tldp.org/HOWTO/NCURSES-Programming-HOWTO/mouse.html" rel="noreferrer">Interfacing with the mouse</a> (from the <a href="http://tldp.org/HOWTO/NCURSES-Programming-HOWTO/" rel="noreferrer">NCurses programming HOWTO</a>) it seems that by enabling the <code>REPORT_MOUSE_POSITION</code> bit in the call to <code>mousemask</code>, one can indeed catch mouse movement events.</p>
  
  <p>So, I tried that and it does not seem to work. I have something like this:</p>
  
  <pre><code>int ch, count=0;
  mmask_t old;
  
  initscr ();
  noecho ();
  cbreak ();
  mousemask (ALL_MOUSE_EVENTS | REPORT_MOUSE_POSITION, &amp;old);
  keypad (stdscr, TRUE);
  
  while ((ch = getchar ()) != 'q')
  {
    count++;
    if (ch == KEY_MOUSE)
    {
       MEVENT event;
       assert (getmouse (&amp;event) == OK);
       mvprintw (0, 0, "Mouse Event!\n");
    }
    mvprintw (1, 1, "Event number %4d",count);
  }
  
  ...
  </code></pre>
  
  <p>I expected that as I'll move my mouse cursor, I'll see the event counter increasing. But it didn't. I also tried moving it while mouse button 1 is down to see if generates "drag" events, and it also didn't do anything. The question is, if it's simply a problem of my terminal emulator? Or maybe I'm misunderstanding what NCurses considers as mouse movement events? All the other mouse events were received (and I can operate programs in the console that use the mouse).</p>
  
  <p>I tried gnome-terminal, xterm, and some other stuff. I also tried a textual environment (without X) by going to the tty's of my linux machine (Fedora 15, Ctrl+Alt+F2) and that did not work.</p>
  
  <p>Finally, assuming I do get this right and those events should be reported, what is the <code>bstate</code> field of a <code>MEVENT</code> for a mouse movement evenet?</p>
  
  <p>Many thanks in advance!</p>