Variable: xterm-mouse-mode-hook

xterm-mouse-mode-hook is a customizable variable defined in xt-mouse.el.gz.

Value

nil

Documentation

Hook run after entering or leaving xterm-mouse-mode(var)/xterm-mouse-mode(fun).

No problems result if this variable is not bound. add-hook automatically binds it. (This is true for all hook variables.)

Source Code

;; Defined in /usr/src/emacs/lisp/xt-mouse.el.gz
;;;###autoload
(define-minor-mode xterm-mouse-mode
  "Toggle XTerm mouse mode.

Turn it on to use Emacs mouse commands, and off to use xterm mouse commands.
This works in terminal emulators compatible with xterm.  It only
works for simple uses of the mouse.  Basically, only non-modified
single clicks are supported.  When turned on, the normal xterm
mouse functionality for such clicks is still available by holding
down the SHIFT key while pressing the mouse button."
  :global t :group 'mouse
  (funcall (if xterm-mouse-mode 'add-hook 'remove-hook)
           'terminal-init-xterm-hook
           'turn-on-xterm-mouse-tracking-on-terminal)
  (if xterm-mouse-mode
      ;; Turn it on
      (progn
        (setq mouse-position-function #'xterm-mouse-position-function
              tty-menu-calls-mouse-position-function t)
        (mapc #'turn-on-xterm-mouse-tracking-on-terminal (terminal-list)))
    ;; Turn it off
    (mapc #'turn-off-xterm-mouse-tracking-on-terminal (terminal-list))
    (setq mouse-position-function nil
          tty-menu-calls-mouse-position-function nil)))