summaryrefslogtreecommitdiffstats
path: root/video
diff options
context:
space:
mode:
authorAkemi <der.richter@gmx.de>2017-03-26 20:32:04 +0200
committerAkemi <der.richter@gmx.de>2017-03-26 20:38:26 +0200
commit063ca8f0fe48c281944c5307b1e8bbb11bb22822 (patch)
tree210cdaf74546f6578fbcedd47610f31773fe685a /video
parentf8a223b7aca08491e22438df0f1ea233d602907c (diff)
downloadmpv-063ca8f0fe48c281944c5307b1e8bbb11bb22822.tar.bz2
mpv-063ca8f0fe48c281944c5307b1e8bbb11bb22822.tar.xz
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.
Diffstat (limited to 'video')
-rw-r--r--video/out/cocoa/events_view.m10
-rw-r--r--video/out/cocoa/mpvadapter.h1
-rw-r--r--video/out/cocoa_common.m8
3 files changed, 0 insertions, 19 deletions
diff --git a/video/out/cocoa/events_view.m b/video/out/cocoa/events_view.m
index 8be74d5e15..3184947a5b 100644
--- a/video/out/cocoa/events_view.m
+++ b/video/out/cocoa/events_view.m
@@ -124,16 +124,6 @@
- (BOOL)resignFirstResponder { return YES; }
-- (void)keyDown:(NSEvent *)event
-{
- [self.adapter putKeyEvent:event];
-}
-
-- (void)keyUp:(NSEvent *)event
-{
- [self.adapter putKeyEvent:event];
-}
-
- (BOOL)canHideCursor
{
return !self.hasMouseDown && [self containsMouseLocation]
diff --git a/video/out/cocoa/mpvadapter.h b/video/out/cocoa/mpvadapter.h
index b5fa8adbf4..eb40df0983 100644
--- a/video/out/cocoa/mpvadapter.h
+++ b/video/out/cocoa/mpvadapter.h
@@ -21,7 +21,6 @@
@interface MpvCocoaAdapter : NSObject<NSWindowDelegate>
- (void)setNeedsResize;
- (void)signalMouseMovement:(NSPoint)point;
-- (void)putKeyEvent:(NSEvent*)event;
- (void)putKey:(int)mpkey withModifiers:(int)modifiers;
- (void)putAxis:(int)mpkey delta:(float)delta;
- (void)putCommand:(char*)cmd;
diff --git a/video/out/cocoa_common.m b/video/out/cocoa_common.m
index bab2c41b0d..5e295ec8ef 100644
--- a/video/out/cocoa_common.m
+++ b/video/out/cocoa_common.m
@@ -810,9 +810,6 @@ static int vo_cocoa_fullscreen(struct vo *vo)
return VO_NOTIMPL;
[s->window toggleFullScreen:nil];
- // for whatever reason sometimes cocoa doesn't create an up event on
- // the fullscreen input key
- cocoa_put_key(MP_INPUT_RELEASE_ALL);
return VO_TRUE;
}
@@ -955,11 +952,6 @@ int vo_cocoa_control(struct vo *vo, int *events, int request, void *arg)
mp_input_set_mouse_pos(self.vout->input_ctx, point.x, point.y);
}
-- (void)putKeyEvent:(NSEvent*)event
-{
- cocoa_put_key_event(event);
-}
-
- (void)putKey:(int)mpkey withModifiers:(int)modifiers
{
cocoa_put_key_with_modifiers(mpkey, modifiers);