help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to get rid of horrible GUI functionality


From: David Hansen
Subject: Re: How to get rid of horrible GUI functionality
Date: Mon, 28 Mar 2016 05:14:37 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux)

Davin Pearson <davin.pearson@gmail.com> writes:

> My new computer is a laptop and from time to time my fingers brush
> against the mouse sensor pad

If you are on GNU/Linux or similar:

(defun turn-off-mouse (&optional _frame)
  (interactive)
  (let ((default-directory "~"))
    (call-process "synclient" nil nil nil "TouchpadOff=1")))

(defun turn-on-mouse (&optional _frame)
  (interactive)
  (let ((default-directory "~"))
    (call-process "synclient" nil nil nil "TouchpadOff=0")))

(add-hook 'focus-in-hook #'turn-off-mouse)
(add-hook 'focus-out-hook #'turn-on-mouse)
(add-hook 'delete-frame-functions #'turn-on-mouse)
(add-hook 'kill-emacs-hook #'turn-on-mouse)

(global-set-key (kbd "C-c m") #'turn-on-mouse)

David




reply via email to

[Prev in Thread] Current Thread [Next in Thread]