bug-ncurses
[Top][All Lists]
Advanced

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

Re: Question about triggering KEY_MOUSE


From: Patrick
Subject: Re: Question about triggering KEY_MOUSE
Date: Tue, 1 Jan 2019 16:58:26 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Icedove/52.9.1

Hi Bryan

There is more to it then this. Here is an example taken from Dan Gookens books, Programming ncurses:


#include <ncurses.h>
int main(void)
{
MEVENT mort;
int ch;
initscr();
noecho();
keypad(stdscr,TRUE);
mousemask(ALL_MOUSE_EVENTS,NULL);
while(1)
{
ch = getch();
if( ch == KEY_MOUSE )
{
getmouse(&mort);
move(0,0);
clrtoeol();
printw(ā€œ%d\t%dā€,mort.y,mort.x);
refresh();
continue;
}
if( ch == ā€˜\nā€™ )
break;
}
endwin();
return 0;
}




reply via email to

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