summaryrefslogtreecommitdiffstats
path: root/osdep/macosx_application_objc.h
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 /osdep/macosx_application_objc.h
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 'osdep/macosx_application_objc.h')
-rw-r--r--osdep/macosx_application_objc.h16
1 files changed, 15 insertions, 1 deletions
diff --git a/osdep/macosx_application_objc.h b/osdep/macosx_application_objc.h
index b569d60f25..7c87ce6fa5 100644
--- a/osdep/macosx_application_objc.h
+++ b/osdep/macosx_application_objc.h
@@ -19,16 +19,30 @@
#import <Cocoa/Cocoa.h>
#include "osdep/macosx_application.h"
-@interface Application : NSObject<NSApplicationDelegate>
+struct cocoa_input_queue;
+
+@interface InputQueue : NSObject
+- (void)push:(int)keycode;
+- (int) pop;
+@end
+
+@interface EventsResponder : NSResponder
+- (NSEvent *)handleKeyDown:(NSEvent *)event;
+@end
+
+@interface Application : NSApplication
- (void)initialize_menu;
- (void)registerSelector:(SEL)selector forKey:(MPMenuKey)key;
- (void)stopPlayback;
@property(nonatomic, assign) struct input_ctx *inputContext;
@property(nonatomic, assign) struct mp_fifo *keyFIFO;
+@property(nonatomic, retain) InputQueue *iqueue;
+@property(nonatomic, retain) EventsResponder *eventsResponder;
@property(nonatomic, retain) NSMutableDictionary *menuItems;
@property(nonatomic, retain) NSArray *files;
@property(nonatomic, retain) NSMutableArray *argumentsList;
@property(nonatomic, assign) BOOL willStopOnOpenEvent;
@end
+Application *mpv_shared_app(void);