diff options
author | Stefano Pigozzi <stefano.pigozzi@gmail.com> | 2013-06-03 00:52:40 +0200 |
---|---|---|
committer | Stefano Pigozzi <stefano.pigozzi@gmail.com> | 2013-06-03 22:35:47 +0200 |
commit | 72f2942dfa575a57d61fe023c845ba711ab78f55 (patch) | |
tree | d62395e98d5ee0ae58a5779bd8b472ee90aa9a80 /osdep/macosx_application_objc.h | |
parent | c39efb96d1109b7a5960cd17cc4c392c2b93b61b (diff) | |
download | mpv-72f2942dfa575a57d61fe023c845ba711ab78f55.tar.bz2 mpv-72f2942dfa575a57d61fe023c845ba711ab78f55.tar.xz |
osx: add Apple Remote support
After killing the non functional AR support in c8fd9e5 I got much complaints so
this adds AR support back in (and it works). I am using the HIDRemote class by
Felix Schwarz and that part of the code is under the BSD license. I slightly
modified it replacing [NSApplication sharedApplication] with NSApp. The code
of the class is quite complex (probably because it had to deal with all the
edge cases with IOKit) but it works nicely as a black box.
In a later commit I'll remove the deprecation warnings caused by HIDRemote's
usage of Gestalt.
Check out `etc/input.conf` for the default bindings.
Apple Remote functionality is automatically compiled in when cocoa is enabled.
It can be disabled at runtime with the `--no-ar` option.
Diffstat (limited to 'osdep/macosx_application_objc.h')
-rw-r--r-- | osdep/macosx_application_objc.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/osdep/macosx_application_objc.h b/osdep/macosx_application_objc.h index 8abe9b98e2..3ab74698c3 100644 --- a/osdep/macosx_application_objc.h +++ b/osdep/macosx_application_objc.h @@ -17,6 +17,7 @@ */ #import <Cocoa/Cocoa.h> +#import "ar/HIDRemote.h" #include "osdep/macosx_application.h" struct cocoa_input_queue; @@ -26,9 +27,12 @@ struct cocoa_input_queue; - (int) pop; @end -@interface EventsResponder : NSResponder +@interface EventsResponder : NSObject <HIDRemoteDelegate> - (void)handleMediaKey:(int)key; - (NSEvent *)handleKeyDown:(NSEvent *)event; +- (void)startAppleRemote; +- (void)stopAppleRemote; +@property(nonatomic, retain) HIDRemote *remote; @end @interface Application : NSApplication |