From dba2b90d9a34055e98c9216bd305a5cb4fb01a3a Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Thu, 9 Oct 2014 21:23:54 +0200 Subject: libmpv/cocoa: don't start the event monitor The event monitor is used to get keyboard events when there is no window, but since it is a global monitor to the current process, we don't want it in a library setting. --- input/input.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'input') diff --git a/input/input.c b/input/input.c index 35377251d1..439a0cf4fa 100644 --- a/input/input.c +++ b/input/input.c @@ -173,6 +173,7 @@ struct input_opts { int use_alt_gr; int use_appleremote; int use_media_keys; + int use_app_events; int default_bindings; int enable_mouse_movements; int vo_key_input; @@ -204,6 +205,7 @@ const struct m_sub_options input_config = { #if HAVE_COCOA OPT_FLAG("appleremote", use_appleremote, CONF_GLOBAL), OPT_FLAG("media-keys", use_media_keys, CONF_GLOBAL), + OPT_FLAG("app-events", use_app_events, CONF_GLOBAL), #endif {0} }, @@ -219,6 +221,7 @@ const struct m_sub_options input_config = { #if HAVE_COCOA .use_appleremote = 1, .use_media_keys = 1, + .use_app_events = 1, #endif .default_bindings = 1, .vo_key_input = 1, @@ -1276,6 +1279,10 @@ void mp_input_load(struct input_ctx *ictx) } #if HAVE_COCOA + if (input_conf->use_app_events) { + cocoa_start_event_monitor(); + } + if (input_conf->use_appleremote) { cocoa_init_apple_remote(); ictx->using_ar = true; -- cgit v1.2.3