From 6b609b8e6d9dfeed7516048f370c00c029632536 Mon Sep 17 00:00:00 2001 From: Dave Davenport Date: Fri, 4 Dec 2015 08:54:27 +0100 Subject: [PATCH] Tell the users what Modifiers exist, warn if using Mod? * Mod? modifier is deprecated. Issue: #290 --- doc/rofi-manpage.markdown | 2 +- source/x11-helper.c | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/doc/rofi-manpage.markdown b/doc/rofi-manpage.markdown index 2cd83d69..c69729d0 100644 --- a/doc/rofi-manpage.markdown +++ b/doc/rofi-manpage.markdown @@ -153,7 +153,7 @@ This does not validate all passed values (e.g. colors). rofi -key-run F12 rofi -key-ssh control+shift+s - rofi -key-window mod1+Tab + rofi -key-window SuperL+Tab `-threads` *num* diff --git a/source/x11-helper.c b/source/x11-helper.c index 920d25d6..c30f33b1 100644 --- a/source/x11-helper.c +++ b/source/x11-helper.c @@ -483,6 +483,10 @@ void x11_parse_key ( char *combo, unsigned int *mod, KeySym *key ) g_string_append_printf ( str, "X11 configured keyboard has no HyperR key.\n" ); } } + int seen_mod = FALSE; + if ( strcasestr ( combo, "Mod")) { + seen_mod = TRUE; + } *mod = modmask; @@ -498,6 +502,12 @@ void x11_parse_key ( char *combo, unsigned int *mod, KeySym *key ) if ( sym == NoSymbol || ( !modmask && ( strchr ( combo, '-' ) || strchr ( combo, '+' ) ) ) ) { // TODO popup g_string_append_printf ( str, "Sorry, rofi cannot understand the key combination: %s\n", combo ); + g_string_append(str, "\nRofi supports the following modifiers:\n\t"); + g_string_append(str, "Shift,Control,Alt,AltGR,SuperL,SuperR,"); + g_string_append(str, "MetaL,MetaR,HyperL,HyperR"); + if(seen_mod) { + g_string_append(str, "\n\nMod1,Mod2,Mod3,Mod4,Mod5 are no longer supported, use one of the above." ); + } } if ( str->len > 0 ) { show_error_message ( str->str, TRUE );