diff options
Diffstat (limited to 'mpvcore')
-rw-r--r-- | mpvcore/input/input.c | 11 | ||||
-rw-r--r-- | mpvcore/input/input.h | 4 | ||||
-rw-r--r-- | mpvcore/options.c | 1 | ||||
-rw-r--r-- | mpvcore/options.h | 1 |
4 files changed, 17 insertions, 0 deletions
diff --git a/mpvcore/input/input.c b/mpvcore/input/input.c index c1711a94d8..8b31352f72 100644 --- a/mpvcore/input/input.c +++ b/mpvcore/input/input.c @@ -550,6 +550,7 @@ struct input_ctx { pthread_mutex_t mutex; struct mp_log *log; + bool using_alt_gr; bool using_ar; bool using_cocoa_media_keys; @@ -635,6 +636,7 @@ const m_option_t mp_input_opts[] = { OPT_FLAG("joystick", input.use_joystick, CONF_GLOBAL), OPT_FLAG("lirc", input.use_lirc, CONF_GLOBAL), OPT_FLAG("lircc", input.use_lircc, CONF_GLOBAL), + OPT_FLAG("right-alt-gr", input.use_alt_gr, CONF_GLOBAL), #if HAVE_COCOA OPT_FLAG("ar", input.use_ar, CONF_GLOBAL), OPT_FLAG("media-keys", input.use_media_keys, CONF_GLOBAL), @@ -2387,6 +2389,10 @@ struct input_ctx *mp_input_init(struct mpv_global *global) } #endif + if (input_conf->use_alt_gr) { + ictx->using_alt_gr = true; + } + #if HAVE_COCOA if (input_conf->use_ar) { cocoa_init_apple_remote(); @@ -2528,3 +2534,8 @@ unsigned int mp_input_get_mouse_event_counter(struct input_ctx *ictx) input_unlock(ictx); return ret; } + +bool mp_input_use_alt_gr(struct input_ctx *ictx) +{ + return ictx->using_alt_gr; +} diff --git a/mpvcore/input/input.h b/mpvcore/input/input.h index 9e897abbbb..2465fe6010 100644 --- a/mpvcore/input/input.h +++ b/mpvcore/input/input.h @@ -287,6 +287,10 @@ void mp_input_wakeup(struct input_ctx *ictx); // Interruptible usleep: (used by demux) int mp_input_check_interrupt(struct input_ctx *ictx, int time); +// If this returns true, use Right Alt key as Alt Gr to produce special +// characters. If false, count Right Alt as the modifier Alt key. +bool mp_input_use_alt_gr(struct input_ctx *ictx); + extern int async_quit_request; #endif /* MPLAYER_INPUT_H */ diff --git a/mpvcore/options.c b/mpvcore/options.c index c8112b496d..08b1f10fe2 100644 --- a/mpvcore/options.c +++ b/mpvcore/options.c @@ -873,6 +873,7 @@ const struct MPOpts mp_default_opts = { .use_joystick = 1, .use_lirc = 1, .use_lircc = 1, + .use_alt_gr = 1, #if HAVE_COCOA .use_ar = 1, .use_media_keys = 1, diff --git a/mpvcore/options.h b/mpvcore/options.h index 3a4333f891..cb700cb775 100644 --- a/mpvcore/options.h +++ b/mpvcore/options.h @@ -251,6 +251,7 @@ typedef struct MPOpts { int use_joystick; int use_lirc; int use_lircc; + int use_alt_gr; int use_ar; int use_media_keys; int default_bindings; |