osx: fix key input in certain circumstances

for a reason i can just assume some key events can vanish from the
event chain and mpv seems unresponsive.

after quite some testing i could confirm that the events are present at
the first entry point of the event chain, the sendEvent method of the
Application, and that they vanish at a point afterwards. now we use
that entry point to grab keyDown and keyUp events. we also stop
propagating those key events to prevent the no key input' error sound.
if we ever need the key events somewhere down the event chain we need
to start propagating them again. though this is not necessary currently.
This commit is contained in:
Akemi
2017-03-26 20:32:04 +02:00
parent f8a223b7ac
commit 063ca8f0fe
12 changed files with 16 additions and 58 deletions

View File

@@ -168,7 +168,6 @@ 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;
@@ -193,7 +192,6 @@ const struct m_sub_options input_config = {
#if HAVE_COCOA
OPT_FLAG("input-appleremote", use_appleremote, 0),
OPT_FLAG("input-media-keys", use_media_keys, 0),
OPT_FLAG("input-app-events", use_app_events, M_OPT_FIXED),
#endif
OPT_FLAG("window-dragging", allow_win_drag, 0),
OPT_REPLACED("input-x11-keyboard", "input-vo-keyboard"),
@@ -210,7 +208,6 @@ 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,
@@ -1298,11 +1295,6 @@ void mp_input_load_config(struct input_ctx *ictx)
talloc_free(tmp);
}
#if HAVE_COCOA
if (ictx->opts->use_app_events)
cocoa_start_event_monitor();
#endif
#if defined(__MINGW32__)
if (ictx->global->opts->input_file && *ictx->global->opts->input_file)
mp_input_pipe_add(ictx, ictx->global->opts->input_file);