mirror of
				https://github.com/labwc/labwc.git
				synced 2025-10-29 05:40:24 -04:00 
			
		
		
		
	keybinds: add support for Meta and Hyper modifiers
The modifiers can be used in keybinds via M-key and H-key Additionally adds support for: - Mod1 (same as A) - Mod3 (same as H) - Mod4 (same as W) - Mod5 (same as M) This is compatible with the format used by Openbox. (http://openbox.org/wiki/Help:Bindings#Syntax) Mod2 (NumLock) and Caps are still not supported due to their locking behavior but could theoretically be added. Fixes: #1061
This commit is contained in:
		
							parent
							
								
									47a80fc4f2
								
							
						
					
					
						commit
						65bd32d625
					
				
					 2 changed files with 11 additions and 3 deletions
				
			
		|  | @ -15,14 +15,19 @@ | |||
| uint32_t | ||||
| parse_modifier(const char *symname) | ||||
| { | ||||
| 	/* Mod2 == NumLock */ | ||||
| 	if (!strcmp(symname, "S")) { | ||||
| 		return WLR_MODIFIER_SHIFT; | ||||
| 	} else if (!strcmp(symname, "C")) { | ||||
| 		return WLR_MODIFIER_CTRL; | ||||
| 	} else if (!strcmp(symname, "A")) { | ||||
| 	} else if (!strcmp(symname, "A") || !strcmp(symname, "Mod1")) { | ||||
| 		return WLR_MODIFIER_ALT; | ||||
| 	} else if (!strcmp(symname, "W")) { | ||||
| 	} else if (!strcmp(symname, "W") || !strcmp(symname, "Mod4")) { | ||||
| 		return WLR_MODIFIER_LOGO; | ||||
| 	} else if (!strcmp(symname, "M") || !strcmp(symname, "Mod5")) { | ||||
| 		return WLR_MODIFIER_MOD5; | ||||
| 	} else if (!strcmp(symname, "H") || !strcmp(symname, "Mod3")) { | ||||
| 		return WLR_MODIFIER_MOD3; | ||||
| 	} else { | ||||
| 		return 0; | ||||
| 	} | ||||
|  |  | |||
|  | @ -130,7 +130,10 @@ static bool is_modifier_key(xkb_keysym_t sym) | |||
| 		|| sym == XKB_KEY_Control_L | ||||
| 		|| sym == XKB_KEY_Control_R | ||||
| 		|| sym == XKB_KEY_Super_L | ||||
| 		|| sym == XKB_KEY_Super_R; | ||||
| 		|| sym == XKB_KEY_Super_R | ||||
| 		/* Right hand Alt key for Mod5 */ | ||||
| 		|| sym == XKB_KEY_Mode_switch | ||||
| 		|| sym == XKB_KEY_ISO_Level3_Shift; | ||||
| } | ||||
| 
 | ||||
| struct keysyms { | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Consolatis
						Consolatis