help-ncurses
[Top][All Lists]
Advanced

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

Mouse no work command line


From: millward
Subject: Mouse no work command line
Date: Wed, 26 Mar 2003 20:21:07 -0600
User-agent: KMail/1.4.1

I'm using Linux Red Hat 7.3.
This code works in a KDE xterm in a user's
account  but not on the command line as root.
How can I get the mouse to work in both?
The mousey stuff is:
#include <ncurses.h>
#include <unistd.h>
int main() { int c;
  WINDOW *winny;
  MEVENT mao;
  initscr();
  clear();
  noecho();
  cbreak();
  winny = newwin( whateve.....);
  keypad( winny, TRUE);
  mousemask(ALL_MOUSE_EVENTS, NULL);
  c = wgetch( winny );
  if ( c == KEY_MOUSE)
    if( getmouse(&mao) == OK)
      if( mao.bstate & BUTTON1_PRESSED )
           ---- DO SOMETHING ----
           refresh();
All this if if if stuff seems very inefficient. Is there
a better way to do it? And how do I get it to
work on the command line as well as xterm?







reply via email to

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