From bb2b7a65ed6ce964527e07843ec0ed86f0b45220 Mon Sep 17 00:00:00 2001 From: Kalle Wallin Date: Sat, 3 Jul 2004 13:02:42 +0000 Subject: [PATCH] Ignore mouse events in wreadln, screen_getch git-svn-id: https://svn.musicpd.org/ncmpc/trunk@1778 09075e82-0dd4-0310-85a5-a0d7c8717e4f --- src/screen_utils.c | 12 ++++++++++-- src/wreadln.c | 7 +++++-- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/src/screen_utils.c b/src/screen_utils.c index c9abc7b..7e2ba14 100644 --- a/src/screen_utils.c +++ b/src/screen_utils.c @@ -65,9 +65,17 @@ screen_getch(WINDOW *w, char *prompt) while( (key=wgetch(w)) == ERR ) ; - + +#ifdef HAVE_GETMOUSE + /* ignore mouse events */ + if( key==KEY_MOUSE ) + return screen_getch(w, prompt); +#endif + if( key==KEY_RESIZE ) - screen_resize(); + { + screen_resize(); + } noecho(); curs_set(0); diff --git a/src/wreadln.c b/src/wreadln.c index dd69b41..3ebba7f 100644 --- a/src/wreadln.c +++ b/src/wreadln.c @@ -23,6 +23,7 @@ #include #include +#include "config.h" #include "wreadln.h" #define KEY_CTRL_A 1 @@ -162,8 +163,10 @@ wreadln(WINDOW *w, switch (key) { - case ERR: - /* ingnore errors */ +#ifdef HAVE_GETMOUSE + case KEY_MOUSE: /* ignore mouse events */ +#endif + case ERR: /* ingnore errors */ break; case KEY_RESIZE: -- 2.30.2