mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-04 09:26:05 +00:00 
			
		
		
		
	Change menu key bindings to Up and Down and also close it on any mouse
press if opened by key.
This commit is contained in:
		@@ -329,10 +329,10 @@ key_bindings_init(void)
 | 
				
			|||||||
		"bind -n MouseDown3StatusRight display-menu -t= -xM -yS -T \"#[align=centre]#{client_name}\" " DEFAULT_CLIENT_MENU,
 | 
							"bind -n MouseDown3StatusRight display-menu -t= -xM -yS -T \"#[align=centre]#{client_name}\" " DEFAULT_CLIENT_MENU,
 | 
				
			||||||
		"bind -n MouseDown3StatusLeft display-menu -t= -xM -yS -T \"#[align=centre]#{session_name}\" " DEFAULT_SESSION_MENU,
 | 
							"bind -n MouseDown3StatusLeft display-menu -t= -xM -yS -T \"#[align=centre]#{session_name}\" " DEFAULT_SESSION_MENU,
 | 
				
			||||||
		"bind -n MouseDown3Status display-menu -t= -xW -yS -T \"#[align=centre]#{window_index}:#{window_name}\" " DEFAULT_WINDOW_MENU,
 | 
							"bind -n MouseDown3Status display-menu -t= -xW -yS -T \"#[align=centre]#{window_index}:#{window_name}\" " DEFAULT_WINDOW_MENU,
 | 
				
			||||||
		"bind C-m display-menu -xW -yS -T \"#[align=centre]#{window_index}:#{window_name}\" " DEFAULT_WINDOW_MENU,
 | 
							"bind Up display-menu -xW -yS -T \"#[align=centre]#{window_index}:#{window_name}\" " DEFAULT_WINDOW_MENU,
 | 
				
			||||||
		"bind -n MouseDown3Pane if -Ft= '#{||:#{mouse_any_flag},#{pane_in_mode}}' 'select-pane -t=; send-keys -M' {display-menu -t= -xM -yM -T \"#[align=centre]#{pane_index} (#{pane_id})\" " DEFAULT_PANE_MENU "}",
 | 
							"bind -n MouseDown3Pane if -Ft= '#{||:#{mouse_any_flag},#{pane_in_mode}}' 'select-pane -t=; send-keys -M' {display-menu -t= -xM -yM -T \"#[align=centre]#{pane_index} (#{pane_id})\" " DEFAULT_PANE_MENU "}",
 | 
				
			||||||
		"bind -n M-MouseDown3Pane display-menu -t= -xM -yM -T \"#[align=centre]#{pane_index} (#{pane_id})\" " DEFAULT_PANE_MENU,
 | 
							"bind -n M-MouseDown3Pane display-menu -t= -xM -yM -T \"#[align=centre]#{pane_index} (#{pane_id})\" " DEFAULT_PANE_MENU,
 | 
				
			||||||
		"bind M-m display-menu -xP -yP -T \"#[align=centre]#{pane_index} (#{pane_id})\" " DEFAULT_PANE_MENU,
 | 
							"bind Down display-menu -xP -yP -T \"#[align=centre]#{pane_index} (#{pane_id})\" " DEFAULT_PANE_MENU,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		"bind -Tcopy-mode C-Space send -X begin-selection",
 | 
							"bind -Tcopy-mode C-Space send -X begin-selection",
 | 
				
			||||||
		"bind -Tcopy-mode C-a send -X start-of-line",
 | 
							"bind -Tcopy-mode C-a send -X start-of-line",
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										5
									
								
								menu.c
									
									
									
									
									
								
							
							
						
						
									
										5
									
								
								menu.c
									
									
									
									
									
								
							@@ -185,8 +185,11 @@ menu_key_cb(struct client *c, struct key_event *event)
 | 
				
			|||||||
	const char			*name;
 | 
						const char			*name;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (KEYC_IS_MOUSE(event->key)) {
 | 
						if (KEYC_IS_MOUSE(event->key)) {
 | 
				
			||||||
		if (md->flags & MENU_NOMOUSE)
 | 
							if (md->flags & MENU_NOMOUSE) {
 | 
				
			||||||
 | 
								if (MOUSE_BUTTONS(m->b) != 0)
 | 
				
			||||||
 | 
									return (1);
 | 
				
			||||||
			return (0);
 | 
								return (0);
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
		if (m->x < md->px ||
 | 
							if (m->x < md->px ||
 | 
				
			||||||
		    m->x > md->px + 4 + menu->width ||
 | 
							    m->x > md->px + 4 + menu->width ||
 | 
				
			||||||
		    m->y < md->py + 1 ||
 | 
							    m->y < md->py + 1 ||
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user