unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: allan gottlieb <gottlieb@nyu.edu>
To: help-gnu-emacs@gnu.org
Subject: Re: query: remapping a mouse press
Date: Mon, 27 Aug 2018 17:13:12 -0400	[thread overview]
Message-ID: <87d0u37btj.fsf@nyu.edu> (raw)
In-Reply-To: <87bm9ng6vs.fsf@himinbjorg.adminart.net> (hw's message of "Mon, 27 Aug 2018 17:35:03 +0200")

On Mon, Aug 27 2018, hw wrote:

> allan gottlieb <gottlieb@nyu.edu> writes:
>
>> On Sun, Aug 26 2018, hw wrote:
>>
>>> allan gottlieb <gottlieb@nyu.edu> writes:
>>>
>>>> On Sun, Aug 26 2018, hw wrote:
>>>>
>>>>> allan gottlieb <gottlieb@nyu.edu> writes:
>>>>>
>> [...]
>>>> I believe that this use of xinput I accomplish with xmodmap.
>>>
>>> How did you do that?
>> [...]
>>
>> I used xev to find our which "logic buttons" is generated by each of the
>> mouse's "physical buttons".  Then I used xmodmap to change the logical
>> buttons (this is easy with xmodmap), but probable that was not necessary.
>
> Oh, I mean what did you put into xmodmap to change mouse buttons?  I
> thought it only deals with keys.

#                     1  2   3  4  5  6  7  8  9 10  11  12
xmodmap -e "pointer = 1  10  3  4  5  6  7  8  9  2  11  12"

This goes in a shell script run at login.  It swaps buttons 10 and 2.

>> [...]
>>>> How do I tell emacs to do something (say end-of-buffer) when button 13
>>>> is pressed?
>>>
>>> Does Emacs receive the event?  You can test with (describe-key).  I
>>> could probably use something like this:
>>>
>>> (global-set-key (kbd "<down-mouse-1>") 'end-of-buffer)
>>
>> Bingo!  (It worked better with just mouse-1 not down-mouse-1)
>>
>>> That might work if Emacs gets <down-mouse-13>.  If it doesn't know that
>>> many buttons and you're not running out of button numbers, perhaps you
>>> can re-map the buttons with xinput so they have lower button mumbers
>>> Emacs can understand.
>>
>> That remapping is what I use xmodmap for (see above).  But it is
>> necessary emacs is delighted with
>>
>>    (global-set-key (kbd "<mouse-8>") 'beginning-of-buffer)
>>
>> Now I have to decide what to do with all the logitech physical buttons!
>
> Cool, now you get to make the really difficult decisions ;)

Agreed.
allan



      reply	other threads:[~2018-08-27 21:13 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-23 20:58 query: remapping a mouse press allan gottlieb
2018-08-23 23:08 ` Tak Kunihiro
     [not found]   ` <87h8jkzaw2.fsf@nyu.edu>
2018-08-25  5:15     ` Tak Kunihiro
2018-08-25 15:38       ` allan gottlieb
2018-08-26 18:10 ` hw
2018-08-26 21:07   ` allan gottlieb
2018-08-26 21:38     ` hw
2018-08-26 22:13       ` allan gottlieb
2018-08-27 15:35         ` hw
2018-08-27 21:13           ` allan gottlieb [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=87d0u37btj.fsf@nyu.edu \
    --to=gottlieb@nyu.edu \
    --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).