summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorStefano Pigozzi <stefano.pigozzi@gmail.com>2013-06-02 17:39:05 +0200
committerStefano Pigozzi <stefano.pigozzi@gmail.com>2013-06-03 22:31:13 +0200
commitf13f0db33a18040e660b6ed76ad43d1870f096a2 (patch)
tree5eb21b606796f0bcd984dd0252666307883c4c49 /core
parent63e2a21c644dad53f5fc256a2d00aef6b171f17c (diff)
downloadmpv-f13f0db33a18040e660b6ed76ad43d1870f096a2.tar.bz2
mpv-f13f0db33a18040e660b6ed76ad43d1870f096a2.tar.xz
osx: create macosx_events to deal with keyDown events
On OSX with Cocoa enabled keyDown events are now handled with addLocalMonitorForEventsMatchingMask:handler:. This allows to respond to events even when there is no VO initialized but the GUI is focused.
Diffstat (limited to 'core')
-rw-r--r--core/input/input.c7
-rw-r--r--core/mplayer.c1
2 files changed, 8 insertions, 0 deletions
diff --git a/core/input/input.c b/core/input/input.c
index c9958753cd..0154fa11aa 100644
--- a/core/input/input.c
+++ b/core/input/input.c
@@ -61,6 +61,10 @@
#include <lirc/lircc.h>
#endif
+#ifdef CONFIG_COCOA
+#include "osdep/macosx_events.h"
+#endif
+
#define MP_MAX_KEY_DOWN 4
struct cmd_bind {
@@ -1474,6 +1478,9 @@ static void read_all_fd_events(struct input_ctx *ictx, int time)
static void read_all_events(struct input_ctx *ictx, int time)
{
getch2_poll();
+#ifdef CONFIG_COCOA
+ cocoa_check_events();
+#endif
read_all_fd_events(ictx, time);
}
diff --git a/core/mplayer.c b/core/mplayer.c
index 52aa34058c..89e79ef044 100644
--- a/core/mplayer.c
+++ b/core/mplayer.c
@@ -3999,6 +3999,7 @@ static void init_input(struct MPContext *mpctx)
#ifdef CONFIG_COCOA
cocoa_set_input_context(mpctx->input);
+ cocoa_set_key_fifo(mpctx->key_fifo);
#endif
}