From: Daniel Carl Date: Mon, 3 Dec 2012 21:24:17 +0000 (+0100) Subject: Fixed none working Upper-Case keybinds like a simple 'G'. X-Git-Url: https://git.owens.tech///git?a=commitdiff_plain;h=d540cc55532cb5808da535f5c033f0c907391432;p=vimb.git Fixed none working Upper-Case keybinds like a simple 'G'. Now 'G' and still work like expected. But at the moment it fells like we will come into trouble later with special fixes and modmask rules. --- diff --git a/src/keybind.c b/src/keybind.c index e9d7836..9306068 100644 --- a/src/keybind.c +++ b/src/keybind.c @@ -169,6 +169,12 @@ static void keybind_str_to_keybind(gchar* str, Keybind* keybind) g_strfreev(string); } + /* set the shift mask for uppercase keys like 'G' */ + guint32 ukval = gdk_keyval_to_unicode(keybind->keyval); + if (g_unichar_isgraph(ukval) && gdk_keyval_is_upper(keybind->keyval)) { + keybind->modmask = GDK_SHIFT_MASK; + } + /* post process the keybinding */ /* special handling for shift tab */ if (keybind->keyval == GDK_Tab && keybind->modmask == GDK_SHIFT_MASK) { @@ -200,7 +206,7 @@ static guint keybind_str_to_value(const gchar* str) static gboolean keybind_keypress_callback(WebKitWebView* webview, GdkEventKey* event) { guint keyval = event->keyval; - guint state = CLEAN_STATE(event); + guint state = CLEAN_STATE_WITH_SHIFT(event); /* check for escape or modkeys or counts */ if (IS_ESCAPE_KEY(keyval, state)) {