summaryrefslogtreecommitdiff
path: root/lisp/menu-bar.el
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2013-10-14 18:37:12 +0300
committerEli Zaretskii <eliz@gnu.org>2013-10-14 18:37:12 +0300
commitccd4a7833f341e2c22d6933357282954af6a57b2 (patch)
treee28e73f9b0e1b85ee9d81adb79d7389c04e4473f /lisp/menu-bar.el
parent77e3b1b7095b3376dbddd22cbca4827b797767c0 (diff)
downloademacs-ccd4a7833f341e2c22d6933357282954af6a57b2.tar.gz
Implement scrolling of TTY menus when the screen is too short.
src/term.c (tty_menu_display): Accept an additional argument, the menu item from which to start displaying the menu. Account for the value of Y when limiting the menu to the number of available screen lines. (mi_result): New enumeration. (read_menu_input): Return enumerated value. When the y coordinate hits min_y or max_y, return scroll indication instead of wrapping around the menu. (tty_menu_activate): Handle the scrolling indications from read_menu_input. Compute the first menu item to display and pass it to tty_menu_display. lisp/menu-bar.el (tty-menu-navigation-map): Bind shifted mouse clicks to commands that scroll the menu.
Diffstat (limited to 'lisp/menu-bar.el')
-rw-r--r--lisp/menu-bar.el12
1 files changed, 9 insertions, 3 deletions
diff --git a/lisp/menu-bar.el b/lisp/menu-bar.el
index 851e9b24649..7a53f968d69 100644
--- a/lisp/menu-bar.el
+++ b/lisp/menu-bar.el
@@ -2341,20 +2341,26 @@ If FRAME is nil or not given, use the selected frame."
(define-key map [linefeed] 'tty-menu-select)
(define-key map [down-mouse-1] 'tty-menu-select)
(define-key map [drag-mouse-1] 'tty-menu-select)
+ ;; 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-drag-mouse-1] 'tty-menu-next-item)
+ (define-key map [S-down-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 [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)
- ;; 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 [mouse-1] 'tty-menu-ignore)
(define-key map [C-mouse-1] 'tty-menu-ignore)
(define-key map [C-mouse-2] 'tty-menu-ignore)