From: nethack.allison Date: Sat, 6 Apr 2002 16:26:38 +0000 (+0000) Subject: mouse fix for nt tty X-Git-Tag: MOVE2GIT~2809 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c6a8fbdd83366fd7a3dd01a68e64522698f35dee;p=nethack mouse fix for nt tty No wonder we've had complaints about the mouse lately. The port was responding to mouse movements that didn't even involve a button click. --- diff --git a/doc/fixes34.1 b/doc/fixes34.1 index 76993152f..be8233145 100644 --- a/doc/fixes34.1 +++ b/doc/fixes34.1 @@ -61,6 +61,7 @@ win32: win32 build no longer defines MICRO win32: allow error save files to be generated win32gui: make error() work; it was essentially non-operative in 3.4.0 win32tty: honour the use_inverse option and default to ATR_BOLD if disabled +win32tty: respond only to mouse clicks not mouse movement X11: restore support for non-square tiles when USE_XPM is defined Gnome: add support for non-square tiles tty: remove #define DEBUG that forced debug behavior in production builds diff --git a/sys/winnt/nttty.c b/sys/winnt/nttty.c index 0ad4e2ba7..5ce3950ff 100644 --- a/sys/winnt/nttty.c +++ b/sys/winnt/nttty.c @@ -432,8 +432,10 @@ int *x, *y, *mod; (ch || (iskeypad(scan)) || altseq)) { *mod = 0; return process_keystroke(&ir, &valid); - } else if ((ir.EventType == MOUSE_EVENT && - (ir.Event.MouseEvent.dwButtonState & MOUSEMASK))) { + } else if ( + (ir.EventType == MOUSE_EVENT && + (ir.Event.MouseEvent.dwEventFlags == 0) && + (ir.Event.MouseEvent.dwButtonState & MOUSEMASK))) { *x = ir.Event.MouseEvent.dwMousePosition.X + 1; *y = ir.Event.MouseEvent.dwMousePosition.Y - 1;