From 2c6af7312cf617f40ab407323fd07a9fa5579495 Mon Sep 17 00:00:00 2001 From: Kalle Wallin Date: Mon, 12 Jul 2004 21:17:27 +0000 Subject: [PATCH] Mouse support is now optional (enable-mouse) git-svn-id: https://svn.musicpd.org/ncmpc/trunk@1861 09075e82-0dd4-0310-85a5-a0d7c8717e4f --- ChangeLog | 5 ++++- src/command.c | 4 ++-- src/conf.c | 5 +++++ src/options.h | 7 ++++--- src/screen.c | 3 ++- src/screen_help.c | 17 ----------------- 6 files changed, 17 insertions(+), 24 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0a995d8..5e22796 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,7 +3,10 @@ at once (-abcde) * conf.c: removed support for the old configuration syntax * list_window.[c.h]: added LW_HIDE_CURSOR_FLAG - * screen_help.c: hide cursor on the help screen + * screen_help.c: hide cursor on the help screen, removed build info + * configure.ac: added --disable-raw-mode + * Added support for SIGSTOP, SIGCONT in raw mode + * Mouse support is now optional (enable-mouse) 2004-07-09 Kalle Wallin * ncmpc-0.11.0 released (r1820) diff --git a/src/command.c b/src/command.c index 6cf3bf1..c8d43d9 100644 --- a/src/command.c +++ b/src/command.c @@ -401,8 +401,8 @@ get_keyboard_command_with_timeout(int ms) return CMD_NONE; #ifdef HAVE_GETMOUSE - // if( key==KEY_MOUSE ) - // return CMD_MOUSE_EVENT; + if( key==KEY_MOUSE ) + return CMD_MOUSE_EVENT; #endif return get_key_command(key); diff --git a/src/conf.c b/src/conf.c index 9dacbfb..f1f1223 100644 --- a/src/conf.c +++ b/src/conf.c @@ -57,6 +57,7 @@ #define CONF_AUDIBLE_BELL "audible-bell" #define CONF_VISIBLE_BELL "visible-bell" #define CONF_XTERM_TITLE "set-xterm-title" +#define CONF_MOUSE_EVENTS "enable-mouse" typedef enum { KEY_PARSER_UNKNOWN, @@ -462,6 +463,10 @@ read_rc_file(char *filename, options_t *options) { options->enable_xterm_title = str2bool(value); } + else if( !strcasecmp(CONF_MOUSE_EVENTS, name) ) + { + options->enable_mouse_events = str2bool(value); + } else { match_found = 0; diff --git a/src/options.h b/src/options.h index 5bc24f3..9cbe386 100644 --- a/src/options.h +++ b/src/options.h @@ -20,9 +20,10 @@ typedef struct gboolean auto_center; gboolean wide_cursor; gboolean enable_colors; - gboolean audible_bell; /* not implemented */ - gboolean visible_bell; /* not implemented */ - gboolean enable_xterm_title; /* not implemented */ + gboolean audible_bell; + gboolean visible_bell; + gboolean enable_xterm_title; + gboolean enable_mouse_events; } options_t; diff --git a/src/screen.c b/src/screen.c index c2c1e7f..9ea46f7 100644 --- a/src/screen.c +++ b/src/screen.c @@ -478,7 +478,8 @@ screen_init(mpdclient_t *c) timeout(SCREEN_TIMEOUT); /* initialize mouse support */ #ifdef HAVE_GETMOUSE - mousemask(ALL_MOUSE_EVENTS, NULL); + if( options.enable_mouse_events ) + mousemask(ALL_MOUSE_EVENTS, NULL); #endif if( COLS