mirror of
https://github.com/mpv-player/mpv
synced 2024-12-22 06:42:03 +00:00
cocoa: move set_input_context to macosx_events
This commit is contained in:
parent
78a2d99de1
commit
4fc8dcde2a
@ -19,8 +19,6 @@
|
||||
#ifndef MPV_MACOSX_APPLICATION
|
||||
#define MPV_MACOSX_APPLICATION
|
||||
|
||||
struct input_ctx;
|
||||
|
||||
typedef int (*mpv_main_fn)(int, char**);
|
||||
|
||||
// Menu Keys identifing menu items
|
||||
@ -46,8 +44,6 @@ void cocoa_run_runloop(void);
|
||||
void cocoa_stop_runloop(void);
|
||||
void cocoa_post_fake_event(void);
|
||||
|
||||
void cocoa_set_input_context(struct input_ctx *input_context);
|
||||
|
||||
void macosx_finder_args_preinit(int *argc, char ***argv);
|
||||
|
||||
#endif /* MPV_MACOSX_APPLICATION */
|
||||
|
@ -373,11 +373,6 @@ void cocoa_stop_runloop(void)
|
||||
cocoa_post_fake_event();
|
||||
}
|
||||
|
||||
void cocoa_set_input_context(struct input_ctx *input_context)
|
||||
{
|
||||
[EventsResponder sharedInstance].inputContext = input_context;
|
||||
}
|
||||
|
||||
void cocoa_post_fake_event(void)
|
||||
{
|
||||
NSEvent* event = [NSEvent otherEventWithType:NSApplicationDefined
|
||||
|
@ -21,6 +21,8 @@
|
||||
#define MACOSX_EVENTS_H
|
||||
#include "input/keycodes.h"
|
||||
|
||||
struct input_ctx;
|
||||
|
||||
void cocoa_put_key(int keycode);
|
||||
void cocoa_put_key_with_modifiers(int keycode, int modifiers);
|
||||
|
||||
@ -30,4 +32,6 @@ void cocoa_uninit_apple_remote(void);
|
||||
void cocoa_init_media_keys(void);
|
||||
void cocoa_uninit_media_keys(void);
|
||||
|
||||
void cocoa_set_input_context(struct input_ctx *input_context);
|
||||
|
||||
#endif
|
||||
|
@ -188,6 +188,11 @@ void cocoa_put_key_with_modifiers(int keycode, int modifiers)
|
||||
cocoa_put_key(keycode);
|
||||
}
|
||||
|
||||
void cocoa_set_input_context(struct input_ctx *input_context)
|
||||
{
|
||||
[EventsResponder sharedInstance].inputContext = input_context;
|
||||
}
|
||||
|
||||
@implementation EventsResponder
|
||||
|
||||
+ (EventsResponder *)sharedInstance
|
||||
|
@ -73,6 +73,7 @@
|
||||
|
||||
#if HAVE_COCOA
|
||||
#include "osdep/macosx_application.h"
|
||||
#include "osdep/macosx_events.h"
|
||||
#endif
|
||||
|
||||
#ifdef PTW32_STATIC_LIB
|
||||
|
Loading…
Reference in New Issue
Block a user