Function: gpm-mouse-mode

gpm-mouse-mode is an autoloaded, interactive and byte-compiled function defined in t-mouse.el.gz.

Signature

(gpm-mouse-mode &optional ARG)

Documentation

Toggle mouse support in GNU/Linux consoles (GPM Mouse mode).

This allows the use of the mouse when operating on a GNU/Linux console, in the same way as you can use the mouse under X11. It relies on the gpm daemon being activated.

Note that when gpm-mouse-mode(var)/gpm-mouse-mode(fun) is enabled, you cannot use the mouse to transfer text between Emacs and other programs which use GPM. This is due to limitations in GPM and the Linux kernel.

This is a global minor mode. If called interactively, toggle the Gpm-Mouse mode mode. If the prefix argument is positive, enable the mode, and if it is zero or negative, disable the mode.

If called from Lisp, toggle the mode if ARG is toggle. Enable the mode if ARG is nil, omitted, or is a positive number. Disable the mode if ARG is a negative number.

To check whether the minor mode is enabled in the current buffer, evaluate (default-value \=gpm-mouse-mode)'.

The mode's hook is called both when the mode is enabled and when it is disabled.

View in manual

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/t-mouse.el.gz
;;;###autoload
(define-minor-mode gpm-mouse-mode
  "Toggle mouse support in GNU/Linux consoles (GPM Mouse mode).

This allows the use of the mouse when operating on a GNU/Linux console,
in the same way as you can use the mouse under X11.
It relies on the `gpm' daemon being activated.

Note that when `gpm-mouse-mode' is enabled, you cannot use the
mouse to transfer text between Emacs and other programs which use
GPM.  This is due to limitations in GPM and the Linux kernel."
  :global t :group 'mouse :init-value t
  (dolist (terminal (terminal-list))
    (when (and (eq t (terminal-live-p terminal))
               (not (eq gpm-mouse-mode
                        (terminal-parameter terminal 'gpm-mouse-active))))
      ;; Simulate selecting a terminal by selecting one of its frames ;-(
      (with-selected-frame (car (frames-on-display-list terminal))
        (gpm-mouse-tty-setup))))
  (when gpm-mouse-mode
    (add-hook 'tty-setup-hook #'gpm-mouse-tty-setup)))