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

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

How to switch off the touchpad when Emacs window is active under Linux?


From: AW
Subject: How to switch off the touchpad when Emacs window is active under Linux?
Date: Mon, 24 Aug 2015 21:02:45 +0200
User-agent: KMail/4.14.10 (Linux/4.1.4-1-desktop; KDE/4.14.10; x86_64; ; )

Hi,

I've got one of those notebooks with a laaaaarge touchpad. I'd like to get it 
switched off when the emacs window under linux is active. I often hit the 
touchpad accidently while typing and move the cursor to another place in the 
buffer. I would like to avoid this.

Somebody (thanks, Bob) showed me this page:

https://www.reddit.com/r/emacs/comments/38o0tr/i_have_to_share_this_switch_your_touchpad_off/

Synclient on this notebook works, but this function doesn't:

======================0

(defun turn-off-mouse (&optional frame)
  (interactive)
  (let ((inhibit-message t) (default-directory "~"))
    (shell-command "synclient TouchpadOff=1")))

(defun turn-on-mouse (&optional frame)
  (interactive)
  (let ((inhibit-message t) (default-directory "~"))
    (shell-command "synclient 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)

=======================

Any suggestions welcome, I'm using openSuse Tumbleweed.


Regards,

Alexander



reply via email to

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