Commit 58ce0cfc authored by Eli Zaretskii's avatar Eli Zaretskii
Browse files

Fix TTY menus when they lead to a minibuffer prompt.

 lisp/menu-bar.el (tty-menu-navigation-map): Bind mouse-N to perform
 TTY menu actions and down-mouse-N to tty-menu-ignore.  This solves
 the problem whereby selecting a menu item that leads to a
 minibuffer prompt moves the cursor out of the minibuffer window,
 making it hard to type at the prompt.  Suggested by Stefan Monnier
 <monnier@iro.umontreal.ca>.
parent 50e28e7d
2013-10-19 Eli Zaretskii <eliz@gnu.org>
* menu-bar.el (tty-menu-navigation-map): Bind mouse-N to perform
TTY menu actions and down-mouse-N to tty-menu-ignore. This solves
the problem whereby selecting a menu item that leads to a
minibuffer prompt moves the cursor out of the minibuffer window,
making it hard to type at the prompt. Suggested by Stefan Monnier
<monnier@iro.umontreal.ca>.
2013-10-19 Jan Djärv <jan.h.d@swipnet.se>
* menu-bar.el: Don't make Services menu.
......
......@@ -2337,36 +2337,38 @@ If FRAME is nil or not given, use the selected frame."
(define-key map [?\C-j] 'tty-menu-select)
(define-key map [return] 'tty-menu-select)
(define-key map [linefeed] 'tty-menu-select)
(define-key map [down-mouse-1] 'tty-menu-select)
(define-key map [mouse-1] 'tty-menu-select)
(define-key map [drag-mouse-1] 'tty-menu-select)
(define-key map [mouse-2] 'tty-menu-select)
(define-key map [drag-mouse-2] 'tty-menu-select)
(define-key map [mouse-3] 'tty-menu-select)
(define-key map [drag-mouse-3] 'tty-menu-select)
(define-key map [wheel-down] 'tty-menu-next-item)
(define-key map [wheel-up] 'tty-menu-prev-item)
(define-key map [wheel-left] 'tty-menu-prev-menu)
(define-key map [wheel-right] 'tty-menu-next-menu)
;; The following 4 bindings are for those whose text-mode mouse
;; lack the wheel.
(define-key map [S-down-mouse-1] 'tty-menu-next-item)
(define-key map [S-mouse-1] 'tty-menu-next-item)
(define-key map [S-drag-mouse-1] 'tty-menu-next-item)
(define-key map [S-down-mouse-2] 'tty-menu-prev-item)
(define-key map [S-mouse-2] 'tty-menu-prev-item)
(define-key map [S-drag-mouse-2] 'tty-menu-prev-item)
(define-key map [mode-line drag-mouse-1] 'tty-menu-select)
(define-key map [mode-line down-mouse-1] 'tty-menu-select)
(define-key map [S-mouse-3] 'tty-menu-prev-item)
(define-key map [S-drag-mouse-3] 'tty-menu-prev-item)
(define-key map [header-line mouse-1] 'tty-menu-select)
(define-key map [header-line drag-mouse-1] 'tty-menu-select)
(define-key map [header-line down-mouse-1] 'tty-menu-select)
;; The mouse events must be bound to tty-menu-ignore, otherwise
;; the initial mouse click will select and immediately pop down
;; the menu.
(define-key map [mode-line mouse-1] 'tty-menu-ignore)
(define-key map [mode-line mouse-2] 'tty-menu-ignore)
(define-key map [mode-line mouse-3] 'tty-menu-ignore)
(define-key map [mode-line C-mouse-1] 'tty-menu-ignore)
(define-key map [mode-line C-mouse-2] 'tty-menu-ignore)
(define-key map [mode-line C-mouse-3] 'tty-menu-ignore)
(define-key map [mouse-1] 'tty-menu-ignore)
(define-key map [C-mouse-1] 'tty-menu-ignore)
(define-key map [C-mouse-2] 'tty-menu-ignore)
(define-key map [C-mouse-3] 'tty-menu-ignore)
;; The down-mouse events must be bound to tty-menu-ignore, so that
;; only releasing the mouse button pops up the menu.
(define-key map [mode-line down-mouse-1] 'tty-menu-ignore)
(define-key map [mode-line down-mouse-2] 'tty-menu-ignore)
(define-key map [mode-line down-mouse-3] 'tty-menu-ignore)
(define-key map [mode-line C-down-mouse-1] 'tty-menu-ignore)
(define-key map [mode-line C-down-mouse-2] 'tty-menu-ignore)
(define-key map [mode-line C-down-mouse-3] 'tty-menu-ignore)
(define-key map [down-mouse-1] 'tty-menu-ignore)
(define-key map [C-down-mouse-1] 'tty-menu-ignore)
(define-key map [C-down-mouse-2] 'tty-menu-ignore)
(define-key map [C-down-mouse-3] 'tty-menu-ignore)
(define-key map [mouse-movement] 'tty-menu-mouse-movement)
map)
"Keymap used while processing TTY menus.")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment