unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Best strategy to disable a touchpad on a laptop when in Emacs?
@ 2021-03-31  0:40 Arthur Miller
  2021-03-31  5:11 ` Jean Louis
  2021-03-31  8:32 ` Yuri Khan
  0 siblings, 2 replies; 14+ messages in thread
From: Arthur Miller @ 2021-03-31  0:40 UTC (permalink / raw)
  To: help-gnu-emacs


I sometimes touch the touchpad accidentally, with a palm and caouse
cursor to jump around or trigger a pop-up. How can I tell Emacs to
ignore all touchpad events? I guess they are registering as mouse
events? I don't use mouse much in Emacs, barely at all, so I oculd live
without mouse completely.

Or can I turn it off per process in the os (windows)? I can't turn the
touchpad of in the system entirely, it is my wife's and I am just
borrowing it sometimes :).



^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Best strategy to disable a touchpad on a laptop when in Emacs?
  2021-03-31  0:40 Best strategy to disable a touchpad on a laptop when in Emacs? Arthur Miller
@ 2021-03-31  5:11 ` Jean Louis
  2021-03-31  5:22   ` Arthur Miller
  2021-03-31  5:23   ` Arthur Miller
  2021-03-31  8:32 ` Yuri Khan
  1 sibling, 2 replies; 14+ messages in thread
From: Jean Louis @ 2021-03-31  5:11 UTC (permalink / raw)
  To: Arthur Miller; +Cc: help-gnu-emacs

* Arthur Miller <arthur.miller@live.com> [2021-03-31 03:41]:
> 
> I sometimes touch the touchpad accidentally, with a palm and caouse
> cursor to jump around or trigger a pop-up. How can I tell Emacs to
> ignore all touchpad events? I guess they are registering as mouse
> events? I don't use mouse much in Emacs, barely at all, so I oculd live
> without mouse completely.
> 
> Or can I turn it off per process in the os (windows)? I can't turn the
> touchpad of in the system entirely, it is my wife's and I am just
> borrowing it sometimes :).

Some solutions are shown here:
https://askubuntu.com/questions/886092/how-do-i-disable-the-touchpad-while-typing

First tell what operating system do you use, and if you use X.org or
what? As solutions vary depending of the environment.

-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns



^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Best strategy to disable a touchpad on a laptop when in Emacs?
  2021-03-31  5:11 ` Jean Louis
@ 2021-03-31  5:22   ` Arthur Miller
  2021-03-31  5:23   ` Arthur Miller
  1 sibling, 0 replies; 14+ messages in thread
From: Arthur Miller @ 2021-03-31  5:22 UTC (permalink / raw)
  To: help-gnu-emacs

Jean Louis <bugs@gnu.support> writes:

> * Arthur Miller <arthur.miller@live.com> [2021-03-31 03:41]:
>> 
>> I sometimes touch the touchpad accidentally, with a palm and caouse
>> cursor to jump around or trigger a pop-up. How can I tell Emacs to
>> ignore all touchpad events? I guess they are registering as mouse
>> events? I don't use mouse much in Emacs, barely at all, so I oculd live
>> without mouse completely.
>> 
>> Or can I turn it off per process in the os (windows)? I can't turn the
>> touchpad of in the system entirely, it is my wife's and I am just
>> borrowing it sometimes :).
>
> Some solutions are shown here:
> https://askubuntu.com/questions/886092/how-do-i-disable-the-touchpad-while-typing
>
> First tell what operating system do you use, and if you use X.org or
> what? As solutions vary depending of the environment.

I was looking for something like how to tell emacs to ignore all mouse
events. The os is Windows, so unfortunately hacking X setup won't
help. Thanks anyway.



^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Best strategy to disable a touchpad on a laptop when in Emacs?
  2021-03-31  5:11 ` Jean Louis
  2021-03-31  5:22   ` Arthur Miller
@ 2021-03-31  5:23   ` Arthur Miller
  2021-03-31  5:40     ` Jean Louis
  1 sibling, 1 reply; 14+ messages in thread
From: Arthur Miller @ 2021-03-31  5:23 UTC (permalink / raw)
  To: help-gnu-emacs

Jean Louis <bugs@gnu.support> writes:

> * Arthur Miller <arthur.miller@live.com> [2021-03-31 03:41]:
>> 
>> I sometimes touch the touchpad accidentally, with a palm and caouse
>> cursor to jump around or trigger a pop-up. How can I tell Emacs to
>> ignore all touchpad events? I guess they are registering as mouse
>> events? I don't use mouse much in Emacs, barely at all, so I oculd live
>> without mouse completely.
>> 
>> Or can I turn it off per process in the os (windows)? I can't turn the
>> touchpad of in the system entirely, it is my wife's and I am just
>> borrowing it sometimes :).
>
> Some solutions are shown here:
> https://askubuntu.com/questions/886092/how-do-i-disable-the-touchpad-while-typing
>
> First tell what operating system do you use, and if you use X.org or
> what? As solutions vary depending of the environment.

Forgott to say: if I got it to work via Emacs, it would be OS independent.



^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Best strategy to disable a touchpad on a laptop when in Emacs?
  2021-03-31  5:23   ` Arthur Miller
@ 2021-03-31  5:40     ` Jean Louis
  2021-03-31  6:05       ` Arthur Miller
  0 siblings, 1 reply; 14+ messages in thread
From: Jean Louis @ 2021-03-31  5:40 UTC (permalink / raw)
  To: Arthur Miller; +Cc: help-gnu-emacs

* Arthur Miller <arthur.miller@live.com> [2021-03-31 08:24]:
> > Some solutions are shown here:
> > https://askubuntu.com/questions/886092/how-do-i-disable-the-touchpad-while-typing
> >
> > First tell what operating system do you use, and if you use X.org or
> > what? As solutions vary depending of the environment.
> 
> Forgott to say: if I got it to work via Emacs, it would be OS independent.

Find a way to disable touchpad on command line in Windows, and make
equivalent to this function below. Do you have such solution?

(defun touchpad-toggle ()
  (interactive)
  (if touchpad-toggle
      (progn
	(setq touchpad-toggle nil)
	(shell-command "xinput disable 11")
	(message "Touchpad disabled"))
    (progn
      (setq touchpad-toggle t)
      (shell-command "xinput enable 11")
      (message "Touchpad enabled"))))

Then you add some hook or process to monitor 2 seconds or more after
typing that it remains disabled.

-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns



^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Best strategy to disable a touchpad on a laptop when in Emacs?
  2021-03-31  5:40     ` Jean Louis
@ 2021-03-31  6:05       ` Arthur Miller
  2021-03-31  6:25         ` Arthur Miller
  0 siblings, 1 reply; 14+ messages in thread
From: Arthur Miller @ 2021-03-31  6:05 UTC (permalink / raw)
  To: help-gnu-emacs

Jean Louis <bugs@gnu.support> writes:

> * Arthur Miller <arthur.miller@live.com> [2021-03-31 08:24]:
>> > Some solutions are shown here:
>> > https://askubuntu.com/questions/886092/how-do-i-disable-the-touchpad-while-typing
>> >
>> > First tell what operating system do you use, and if you use X.org or
>> > what? As solutions vary depending of the environment.
>> 
>> Forgott to say: if I got it to work via Emacs, it would be OS independent.
>
> Find a way to disable touchpad on command line in Windows, and make
> equivalent to this function below. Do you have such solution?
>
> (defun touchpad-toggle ()
>   (interactive)
>   (if touchpad-toggle
>       (progn
> 	(setq touchpad-toggle nil)
> 	(shell-command "xinput disable 11")
> 	(message "Touchpad disabled"))
>     (progn
>       (setq touchpad-toggle t)
>       (shell-command "xinput enable 11")
>       (message "Touchpad enabled"))))
>
> Then you add some hook or process to monitor 2 seconds or more after
> typing that it remains disabled.

I know how to call a shell command from Emacs Jean. I don't want to turn
off and on the touchpad every time I borrow the computer. I will sooner
or later forgett it and the best of all best ladies will be annoyed why
her computer does not work any more :). I just want it to now work in
Emacs, not in other apps. I found disable-mouse by Purcell, I'll see how
that one works.



^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Best strategy to disable a touchpad on a laptop when in Emacs?
  2021-03-31  6:05       ` Arthur Miller
@ 2021-03-31  6:25         ` Arthur Miller
  2021-03-31  6:55           ` Jean Louis
  0 siblings, 1 reply; 14+ messages in thread
From: Arthur Miller @ 2021-03-31  6:25 UTC (permalink / raw)
  To: help-gnu-emacs

Arthur Miller <arthur.miller@live.com> writes:

> Jean Louis <bugs@gnu.support> writes:
>
>> * Arthur Miller <arthur.miller@live.com> [2021-03-31 08:24]:
>>> > Some solutions are shown here:
>>> > https://askubuntu.com/questions/886092/how-do-i-disable-the-touchpad-while-typing
>>> >
>>> > First tell what operating system do you use, and if you use X.org or
>>> > what? As solutions vary depending of the environment.
>>> 
>>> Forgott to say: if I got it to work via Emacs, it would be OS independent.
>>
>> Find a way to disable touchpad on command line in Windows, and make
>> equivalent to this function below. Do you have such solution?
>>
>> (defun touchpad-toggle ()
>>   (interactive)
>>   (if touchpad-toggle
>>       (progn
>> 	(setq touchpad-toggle nil)
>> 	(shell-command "xinput disable 11")
>> 	(message "Touchpad disabled"))
>>     (progn
>>       (setq touchpad-toggle t)
>>       (shell-command "xinput enable 11")
>>       (message "Touchpad enabled"))))
>>
>> Then you add some hook or process to monitor 2 seconds or more after
>> typing that it remains disabled.
>
> I know how to call a shell command from Emacs Jean. I don't want to turn
> off and on the touchpad every time I borrow the computer. I will sooner
> or later forgett it and the best of all best ladies will be annoyed why
> her computer does not work any more :). I just want it to now work in
> Emacs, not in other apps. I found disable-mouse by Purcell, I'll see how
> that one works.

disable-mouse works good enough seems like, at least good enough for me,
so I'll go with that. Thanks Purcell!

By the way, I just found a blog post by Malabarba (Endless Parenthesses)
about same issue:

https://endlessparentheses.com/disable-mouse-only-inside-emacs.html




^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Best strategy to disable a touchpad on a laptop when in Emacs?
  2021-03-31  6:25         ` Arthur Miller
@ 2021-03-31  6:55           ` Jean Louis
  2021-03-31 10:33             ` Arthur Miller
  0 siblings, 1 reply; 14+ messages in thread
From: Jean Louis @ 2021-03-31  6:55 UTC (permalink / raw)
  To: Arthur Miller; +Cc: help-gnu-emacs

* Arthur Miller <arthur.miller@live.com> [2021-03-31 09:33]:
> disable-mouse works good enough seems like, at least good enough for me,
> so I'll go with that. Thanks Purcell!

OK you really wish to disable touchpad explicitly. I was thinking you
are finding solution to disable touchpad while typing so that palm
does not interfer with it.

-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns



^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Best strategy to disable a touchpad on a laptop when in Emacs?
  2021-03-31  0:40 Best strategy to disable a touchpad on a laptop when in Emacs? Arthur Miller
  2021-03-31  5:11 ` Jean Louis
@ 2021-03-31  8:32 ` Yuri Khan
  2021-03-31 10:31   ` Arthur Miller
  1 sibling, 1 reply; 14+ messages in thread
From: Yuri Khan @ 2021-03-31  8:32 UTC (permalink / raw)
  To: Arthur Miller; +Cc: help-gnu-emacs

On Wed, 31 Mar 2021 at 07:40, Arthur Miller <arthur.miller@live.com> wrote:

Problem statement:

> I sometimes touch the touchpad accidentally, with a palm and caouse
> cursor to jump around or trigger a pop-up.

Relevant context:

> I can't turn the
> touchpad of in the system entirely, it is my wife's and I am just
> borrowing it sometimes

Proposed approach:

> How can I tell Emacs to ignore all touchpad events?

…and as far as I can see you got the problem solved that way.

However, have a different approach that might be applicable in some
circumstances:

Connect an external, your own keyboard when using other people’s
laptops. This way, you (1) have a comfortable and familiar keyboard,
(2) do not approach the touchpad sufficiently to accidentally touch
it.



^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Best strategy to disable a touchpad on a laptop when in Emacs?
  2021-03-31  8:32 ` Yuri Khan
@ 2021-03-31 10:31   ` Arthur Miller
  2021-03-31 10:34     ` Jean Louis
  0 siblings, 1 reply; 14+ messages in thread
From: Arthur Miller @ 2021-03-31 10:31 UTC (permalink / raw)
  To: Yuri Khan; +Cc: help-gnu-emacs

Yuri Khan <yuri.v.khan@gmail.com> writes:

> On Wed, 31 Mar 2021 at 07:40, Arthur Miller <arthur.miller@live.com> wrote:
>
> Problem statement:
>
>> I sometimes touch the touchpad accidentally, with a palm and caouse
>> cursor to jump around or trigger a pop-up.
>
> Relevant context:
>
>> I can't turn the
>> touchpad of in the system entirely, it is my wife's and I am just
>> borrowing it sometimes
>
> Proposed approach:
>
>> How can I tell Emacs to ignore all touchpad events?
>
> …and as far as I can see you got the problem solved that way.
>
> However, have a different approach that might be applicable in some
> circumstances:
>
> Connect an external, your own keyboard when using other people’s
> laptops. This way, you (1) have a comfortable and familiar keyboard,
> (2) do not approach the touchpad sufficiently to accidentally touch
> it.
Yes indeed, but I am away from home and don't wanna carry around a
keyboard. Disable-mouse-mode, works really fine. The touchpad still
moves pointer around; would like to turn off pointer motion too, but
presses are ignored, so it is good enough.



^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Best strategy to disable a touchpad on a laptop when in Emacs?
  2021-03-31  6:55           ` Jean Louis
@ 2021-03-31 10:33             ` Arthur Miller
  2021-03-31 10:36               ` Jean Louis
  0 siblings, 1 reply; 14+ messages in thread
From: Arthur Miller @ 2021-03-31 10:33 UTC (permalink / raw)
  To: help-gnu-emacs

Jean Louis <bugs@gnu.support> writes:

> * Arthur Miller <arthur.miller@live.com> [2021-03-31 09:33]:
>> disable-mouse works good enough seems like, at least good enough for me,
>> so I'll go with that. Thanks Purcell!
>
> OK you really wish to disable touchpad explicitly. I was thinking you
> are finding solution to disable touchpad while typing so that palm
> does not interfer with it.

Well, yes, that is what I wanted, but only in Emacs, not in other
applications. I don't wanna go click every now and then in some system
dialog or something. Disable-mouse-mode does the job.




^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Best strategy to disable a touchpad on a laptop when in Emacs?
  2021-03-31 10:31   ` Arthur Miller
@ 2021-03-31 10:34     ` Jean Louis
  0 siblings, 0 replies; 14+ messages in thread
From: Jean Louis @ 2021-03-31 10:34 UTC (permalink / raw)
  To: Arthur Miller; +Cc: help-gnu-emacs, Yuri Khan

* Arthur Miller <arthur.miller@live.com> [2021-03-31 13:32]:
> Yuri Khan <yuri.v.khan@gmail.com> writes:
> 
> > On Wed, 31 Mar 2021 at 07:40, Arthur Miller <arthur.miller@live.com> wrote:
> >
> > Problem statement:
> >
> >> I sometimes touch the touchpad accidentally, with a palm and caouse
> >> cursor to jump around or trigger a pop-up.
> >
> > Relevant context:
> >
> >> I can't turn the
> >> touchpad of in the system entirely, it is my wife's and I am just
> >> borrowing it sometimes
> >
> > Proposed approach:
> >
> >> How can I tell Emacs to ignore all touchpad events?
> >
> > …and as far as I can see you got the problem solved that way.
> >
> > However, have a different approach that might be applicable in some
> > circumstances:
> >
> > Connect an external, your own keyboard when using other people’s
> > laptops. This way, you (1) have a comfortable and familiar keyboard,
> > (2) do not approach the touchpad sufficiently to accidentally touch
> > it.
> Yes indeed, but I am away from home and don't wanna carry around a
> keyboard. Disable-mouse-mode, works really fine. The touchpad still
> moves pointer around; would like to turn off pointer motion too, but
> presses are ignored, so it is good enough.


To disable that you could just do:

(define-minor-mode disable-mouse-mode
  "A minor-mode that disables all mouse keybinds."
  :global t
  :lighter " 🐭"
  :keymap (make-sparse-keymap))

(dolist (type '(mouse down-mouse drag-mouse
                      double-mouse triple-mouse))
  (dolist (prefix '("" C- M- S- M-S- C-M- C-S- C-M-S-))
    ;; Yes, I actually HAD to go up to 7 here.
    (dotimes (n 7)
      (let ((k (format "%s%s-%s" prefix type n)))
        (define-key disable-mouse-mode-map
          (vector (intern k)) #'ignore)))))

(disable-mouse-mode 1)

as from:
https://endlessparentheses.com/disable-mouse-only-inside-emacs.html


-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns




^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Best strategy to disable a touchpad on a laptop when in Emacs?
  2021-03-31 10:33             ` Arthur Miller
@ 2021-03-31 10:36               ` Jean Louis
  2021-03-31 12:34                 ` Arthur Miller
  0 siblings, 1 reply; 14+ messages in thread
From: Jean Louis @ 2021-03-31 10:36 UTC (permalink / raw)
  To: Arthur Miller; +Cc: help-gnu-emacs

* Arthur Miller <arthur.miller@live.com> [2021-03-31 13:34]:
> Jean Louis <bugs@gnu.support> writes:
> 
> > * Arthur Miller <arthur.miller@live.com> [2021-03-31 09:33]:
> >> disable-mouse works good enough seems like, at least good enough for me,
> >> so I'll go with that. Thanks Purcell!
> >
> > OK you really wish to disable touchpad explicitly. I was thinking you
> > are finding solution to disable touchpad while typing so that palm
> > does not interfer with it.
> 
> Well, yes, that is what I wanted, but only in Emacs, not in other
> applications. I don't wanna go click every now and then in some system
> dialog or something. Disable-mouse-mode does the job.

For this function:
https://endlessparentheses.com/disable-mouse-only-inside-emacs.html

- how can we turn on that minor mode this function with the first key
  typed? That would disable the touchpad during typing.

- how can we turn off that minor mode, 2 or number seconds after
  typing?

-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns




^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Best strategy to disable a touchpad on a laptop when in Emacs?
  2021-03-31 10:36               ` Jean Louis
@ 2021-03-31 12:34                 ` Arthur Miller
  0 siblings, 0 replies; 14+ messages in thread
From: Arthur Miller @ 2021-03-31 12:34 UTC (permalink / raw)
  To: help-gnu-emacs

Jean Louis <bugs@gnu.support> writes:

> * Arthur Miller <arthur.miller@live.com> [2021-03-31 13:34]:
>> Jean Louis <bugs@gnu.support> writes:
>> 
>> > * Arthur Miller <arthur.miller@live.com> [2021-03-31 09:33]:
>> >> disable-mouse works good enough seems like, at least good enough for me,
>> >> so I'll go with that. Thanks Purcell!
>> >
>> > OK you really wish to disable touchpad explicitly. I was thinking you
>> > are finding solution to disable touchpad while typing so that palm
>> > does not interfer with it.
>> 
>> Well, yes, that is what I wanted, but only in Emacs, not in other
>> applications. I don't wanna go click every now and then in some system
>> dialog or something. Disable-mouse-mode does the job.
>
> For this function:
> https://endlessparentheses.com/disable-mouse-only-inside-emacs.html
>
> - how can we turn on that minor mode this function with the first key
>   typed? That would disable the touchpad during typing.
>
> - how can we turn off that minor mode, 2 or number seconds after
>   typing?

You could put it on an idle timer, but why?

There is no reason to turn that mode on or off at all. Emacs is all
about typing keys. I don't see how I would use Emacs otherwise. I rarely
use mouse even normally on my desktop. I don't see the point of
constantly turning it on/off. It would be just unnecessary processing,
really. So I have put (global-disable-mouse-mode 1) in my init file.

By the way, to answer your previous mail too, I have seen Malabarba's
blog. Purcell's disable-mouse-mode does everything there already. You
can get it from his GH: https://github.com/purcell/disable-mouse




^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2021-03-31 12:34 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-03-31  0:40 Best strategy to disable a touchpad on a laptop when in Emacs? Arthur Miller
2021-03-31  5:11 ` Jean Louis
2021-03-31  5:22   ` Arthur Miller
2021-03-31  5:23   ` Arthur Miller
2021-03-31  5:40     ` Jean Louis
2021-03-31  6:05       ` Arthur Miller
2021-03-31  6:25         ` Arthur Miller
2021-03-31  6:55           ` Jean Louis
2021-03-31 10:33             ` Arthur Miller
2021-03-31 10:36               ` Jean Louis
2021-03-31 12:34                 ` Arthur Miller
2021-03-31  8:32 ` Yuri Khan
2021-03-31 10:31   ` Arthur Miller
2021-03-31 10:34     ` Jean Louis

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).