mirror of
https://github.com/mpv-player/mpv.git
synced 2025-12-28 05:33:14 +00:00
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.
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user