From: "Pascal J. Bourguignon" <pjb@informatimago.com>
To: help-gnu-emacs@gnu.org
Subject: Re: How to switch off the touchpad when Emacs window is active under Linux?
Date: Mon, 24 Aug 2015 21:37:43 +0200 [thread overview]
Message-ID: <87io845vg8.fsf@kuiper.lan.informatimago.com> (raw)
In-Reply-To: mailman.28.1440443703.28410.help-gnu-emacs@gnu.org
Ian Zimmerman <itz@buug.org> writes:
> On 2015-08-24 21:02 +0200, AW wrote:
>
>> Synclient on this notebook works, but this function doesn't:
>
>> (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)
>
> The variable inhibit-message doesn't exist in my emacs (probably a
> recent addition), but I'm guessing that it discards any output from the
> subprocess. I would leave it out so you see what prevents synclient
> from working.
>
> Also, I don't see why changing default-directory should be necessary,
> either.
Alternatively, you could disable the mouse by binding all the mouse
events to null commands. For example, I have this in my ~/.emacs; you
could extend it to all mouse buttons:
(defun ignore () (interactive))
(loop for key in (list (kbd "<mouse-5>") (kbd "C-<mouse-5>") (kbd "S-<mouse-5>")
(kbd "<mouse-4>") (kbd "C-<mouse-4>") (kbd "S-<mouse-4>"))
do (global-set-key key 'ignore))
--
__Pascal Bourguignon__ http://www.informatimago.com/
“The factory of the future will have only two employees, a man and a
dog. The man will be there to feed the dog. The dog will be there to
keep the man from touching the equipment.” -- Carl Bass CEO Autodesk
prev parent reply other threads:[~2015-08-24 19:37 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-24 19:02 How to switch off the touchpad when Emacs window is active under Linux? AW
2015-08-24 19:14 ` Ian Zimmerman
2015-08-24 19:51 ` AW
[not found] ` <mailman.28.1440443703.28410.help-gnu-emacs@gnu.org>
2015-08-24 19:37 ` Pascal J. Bourguignon [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87io845vg8.fsf@kuiper.lan.informatimago.com \
--to=pjb@informatimago.com \
--cc=help-gnu-emacs@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).