|
From: | jochen.walborn |
Subject: | Mouse Support |
Date: | Mon, 03 Jan 2005 06:50:57 GMT |
Hello,
the mouse part of the source code below doesn't work as expected.
The event KEY_MOUSE doesn't occur when moving or clicking the mouse.
What could be wrong ?
regards
Jochen Walborn
#############################################################################
#include <curses.h>
int main( void )
{
WINDOW *psFirstWin;
int i = ERR, j;
MEVENT sM;
initscr();
refresh();
keypad( stdscr, TRUE );
nodelay( stdscr, TRUE );
noecho();
psFirstWin = newwin( 10, 20, 5, 5 ); /* create new window */
box( psFirstWin, 0, 0 ); /* draw box around the window */
/* 0,0 means default char's */
wrefresh( psFirstWin ); /* draw the window on the screen */
mousemask( ALL_MOUSE_EVENTS, NULL ); /* capture all mouse events */
while( 1 )
{
i = wgetch( psFirstWin );
if( i == 10 )
break;
if( i == KEY_MOUSE )
{
j = getmouse( &sM );
mvprintw( 1, 0, "%u %u %u", sM.x, sM.y, sM.z );
}
}
endwin();
return( 0 );
}
Online Viren Scan: Scannen Sie Ihren PC jetzt kostenlos online Jetzt scannen!
[Prev in Thread] | Current Thread | [Next in Thread] |