all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Binding keys to echo area mouse events
@ 2021-01-03 16:37 Amin Bandali
  2021-01-03 16:46 ` Stefan Monnier
  0 siblings, 1 reply; 5+ messages in thread
From: Amin Bandali @ 2021-01-03 16:37 UTC (permalink / raw)
  To: help-gnu-emacs

Hello,

Is it possible to capture mouse/scroll events on the echo area?

For the mode-line, something like the following works:

    (global-set-key (kbd "<mode-line> <mouse-4>") #'b/exwm-ws-prev)
    (global-set-key (kbd "<mode-line> <mouse-5>") #'b/exwm-ws-next)

Which allows me to switch to my previous and next EXWM workspace.
I'd like to do the same for the echo area, but  I'm not quite sure if
it's possible as of now.



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

* Re: Binding keys to echo area mouse events
  2021-01-03 16:37 Binding keys to echo area mouse events Amin Bandali
@ 2021-01-03 16:46 ` Stefan Monnier
  2021-01-03 16:57   ` Stefan Monnier
  0 siblings, 1 reply; 5+ messages in thread
From: Stefan Monnier @ 2021-01-03 16:46 UTC (permalink / raw)
  To: help-gnu-emacs

> Is it possible to capture mouse/scroll events on the echo area?
>
> For the mode-line, something like the following works:
>
>     (global-set-key (kbd "<mode-line> <mouse-4>") #'b/exwm-ws-prev)
>     (global-set-key (kbd "<mode-line> <mouse-5>") #'b/exwm-ws-next)
>
> Which allows me to switch to my previous and next EXWM workspace.
> I'd like to do the same for the echo area, but  I'm not quite sure if
> it's possible as of now.

If you're using a separate minibuffer-only frame, then you can use
`minibuffer-inactive-mode` (and its `minibuffer-inactive-mode-map`)
which might do the trick.

If not, then I think you'll need to make changes to the C code because
otherwise any event sent to the echo area signals "Minibuffer window is
not active".


        Stefan




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

* Re: Binding keys to echo area mouse events
  2021-01-03 16:46 ` Stefan Monnier
@ 2021-01-03 16:57   ` Stefan Monnier
  2021-01-03 17:12     ` Amin Bandali
  0 siblings, 1 reply; 5+ messages in thread
From: Stefan Monnier @ 2021-01-03 16:57 UTC (permalink / raw)
  To: help-gnu-emacs

> If not, then I think you'll need to make changes to the C code because
> otherwise any event sent to the echo area signals "Minibuffer window is
> not active".

Actually, scratch that: this signal comes from Elisp code, so I was
just confused.


        Stefan




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

* Re: Binding keys to echo area mouse events
  2021-01-03 16:57   ` Stefan Monnier
@ 2021-01-03 17:12     ` Amin Bandali
  2021-01-03 17:26       ` Stefan Monnier
  0 siblings, 1 reply; 5+ messages in thread
From: Amin Bandali @ 2021-01-03 17:12 UTC (permalink / raw)
  To: help-gnu-emacs

Stefan Monnier writes:

>> If not, then I think you'll need to make changes to the C code because
>> otherwise any event sent to the echo area signals "Minibuffer window is
>> not active".
>
> Actually, scratch that: this signal comes from Elisp code, so I was
> just confused.

:-) Indeed, the following seems to be working just fine:

(define-key minibuffer-inactive-mode-map [mouse-4] #'b/exwm-ws-prev)
(define-key minibuffer-inactive-mode-map [mouse-5] #'b/exwm-ws-next)

>
>         Stefan

Thanks!
amin



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

* Re: Binding keys to echo area mouse events
  2021-01-03 17:12     ` Amin Bandali
@ 2021-01-03 17:26       ` Stefan Monnier
  0 siblings, 0 replies; 5+ messages in thread
From: Stefan Monnier @ 2021-01-03 17:26 UTC (permalink / raw)
  To: help-gnu-emacs

> :-) Indeed, the following seems to be working just fine:
>
> (define-key minibuffer-inactive-mode-map [mouse-4] #'b/exwm-ws-prev)
> (define-key minibuffer-inactive-mode-map [mouse-5] #'b/exwm-ws-next)

Great.  I was about to go and fix the doc accordingly, but I see that it
already correctly says that the problems I was thinking of affect the
*non-mouse* bindings.


        Stefan




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

end of thread, other threads:[~2021-01-03 17:26 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-01-03 16:37 Binding keys to echo area mouse events Amin Bandali
2021-01-03 16:46 ` Stefan Monnier
2021-01-03 16:57   ` Stefan Monnier
2021-01-03 17:12     ` Amin Bandali
2021-01-03 17:26       ` Stefan Monnier

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.