GNU bug report logs - #56779
29.0.50; [wishlist] Function to check if a mouse-button is pressed

Previous Next

Package: emacs;

Reported by: Visuwesh <visuweshm <at> gmail.com>

Date: Tue, 26 Jul 2022 08:59:02 UTC

Severity: wishlist

Found in version 29.0.50

Full log


View this message in rfc822 format

From: Visuwesh <visuweshm <at> gmail.com>
To: 56779 <at> debbugs.gnu.org
Cc: luangruo <at> yahoo.com
Subject: bug#56779: 29.0.50; [wishlist] Function to check if a mouse-button is pressed
Date: Tue, 26 Jul 2022 15:51:54 +0530
[செவ்வாய் ஜூலை 26, 2022] Po Lu via "Bug reports for GNU Emacs, the Swiss army knife of text editors" wrote:

> Visuwesh <visuweshm <at> gmail.com> writes:
>
>> Currently, to know if a mouse button is being pressed, one has to keep
>> track of state by cleverly utilising [down-mouse-N] and [mouse-N] events
>> (see [1]).  It is certainly no easy task, it would be really nice if
>> Emacs had the equivalent of `xinput --query-state <mouse-id>' [2]
>> (the implementation of which can be found in state.c in xinput's
>> source).
>
> Relying on the X input extension is not portable, not only outside of
> X, but also inside Emacs, which supports being run on X servers where
> the input extension is not available.
>
> How about a function that returns a list of mouse buttons currently held
> down on a given terminal? That would be very straightforward to
> implement.

That would work just fine with me, thanks.  I pointed out xinput since
that was the first straightforward thing that came up when I searched
the internet.  BTW, it would be nice if the order of the buttons was in
the order they were pressed i.e., if I pressed mouse-1 then mouse-2 the
list would be (mouse-2 mouse-1).




This bug report was last modified 2 years and 325 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.