mirror of
https://github.com/davatorium/rofi.git
synced 2024-11-11 13:50:48 -05:00
Permit binding a modifier key on its own
This commit is contained in:
parent
999bf56b7e
commit
8af7f014cd
1 changed files with 11 additions and 3 deletions
|
@ -500,14 +500,22 @@ gboolean x11_parse_key ( char *combo, unsigned int *mod, xkb_keysym_t *key, gboo
|
|||
seen_mod = TRUE;
|
||||
}
|
||||
|
||||
*mod = modmask;
|
||||
|
||||
// Skip modifier (if exist) and parse key.
|
||||
// Find location of modifier (if it exists)
|
||||
char i = strlen ( combo );
|
||||
|
||||
while ( i > 0 && !strchr ( "-+", combo[i - 1] ) ) {
|
||||
i--;
|
||||
}
|
||||
|
||||
// if there's no "-" or "+", we might be binding directly to a modifier key - no modmask
|
||||
if( i == 0 ) {
|
||||
*mod = 0;
|
||||
}
|
||||
else {
|
||||
*mod = modmask;
|
||||
}
|
||||
|
||||
// Parse key
|
||||
xkb_keysym_t sym = XKB_KEY_NoSymbol;
|
||||
if ( ( modmask & x11_mod_masks[X11MOD_SHIFT] ) != 0 ) {
|
||||
gchar * str = g_utf8_next_char ( combo + i );
|
||||
|
|
Loading…
Reference in a new issue