mirror of
				https://github.com/labwc/labwc.git
				synced 2025-11-03 09:01:51 -05:00 
			
		
		
		
	keyboard: allow back by arrow-up or arrow-left in cycle view OSD
All non-modifier keys cycle forward which makes sense for e.g. tab but is not very intuitive for arrow-up or arrow-left. Handle those keys separately to provide a feel of navigation by arrow keys in the cycle view OSD.
This commit is contained in:
		
							parent
							
								
									738ae6c5d5
								
							
						
					
					
						commit
						590ec0c77d
					
				
					 1 changed files with 10 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -354,8 +354,17 @@ handle_cycle_view_key(struct server *server, struct keyinfo *keyinfo)
 | 
			
		|||
	}
 | 
			
		||||
 | 
			
		||||
	/* cycle to next */
 | 
			
		||||
	bool backwards = keyinfo->modifiers & WLR_MODIFIER_SHIFT;
 | 
			
		||||
	if (!keyinfo->is_modifier) {
 | 
			
		||||
		bool back_key = false;
 | 
			
		||||
		for (int i = 0; i < keyinfo->translated.nr_syms; i++) {
 | 
			
		||||
			if (keyinfo->translated.syms[i] == XKB_KEY_Up
 | 
			
		||||
					|| keyinfo->translated.syms[i] == XKB_KEY_Left) {
 | 
			
		||||
				back_key = true;
 | 
			
		||||
				break;
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
		bool backwards = (keyinfo->modifiers & WLR_MODIFIER_SHIFT) || back_key;
 | 
			
		||||
 | 
			
		||||
		enum lab_cycle_dir dir = backwards
 | 
			
		||||
			? LAB_CYCLE_DIR_BACKWARD
 | 
			
		||||
			: LAB_CYCLE_DIR_FORWARD;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue