From 6fb020f5de1487484712e7113db0e86dd97481bd Mon Sep 17 00:00:00 2001 From: Vivek Jain Date: Sat, 30 Nov 2013 21:23:39 -0800 Subject: options: add option to disable using right Alt key as Alt Gr mpv was hardcoded to always consider the right Alt key as Alt Gr, but there are parituclar combinations of platforms and keyboard layouts where it's more convenient to treat the right Alt as a keyboard modifier just like the left one. Fixes #388 --- mpvcore/input/input.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'mpvcore/input/input.c') 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; +} -- cgit v1.2.3