[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: query: remapping a mouse press
From: |
allan gottlieb |
Subject: |
Re: query: remapping a mouse press |
Date: |
Sun, 26 Aug 2018 18:13:15 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) |
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 am having trouble enabling mouse-wheel-tilt-scroll
>> [...]
>>> You can use xinput to configure which physical button on a mouse
>>> (or trackball,
>>> in this example) is being mapped to which logical button like so:
>> [...]
>>
>> Thank you.
>>
>> I believe that this use of xinput I accomplish with xmodmap.
>
> How did you do that? I prefer xmodmap because it's way less
> complicated, but there seem to be things that can not be done with it,
> and mapping mouse buttons seemed to be one of them.
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.
>> My question is "downstream" of that. Assuming I have configured the
>> mouse (in my case via xmodmap) and when I push a certain physical button
>> it generates a pair of x events
>>
>> ButtonPress event, serial 36, synthetic NO, window 0x4200001,
>> root 0x13b, subw 0x0, time 28609618, (45,96), root:(464,877),
>> state 0x10, button 13, same_screen YES
>>
>> ButtonRelease event, serial 36, synthetic NO, window 0x4200001,
>> root 0x13b, subw 0x0, time 28609820, (54,94), root:(473,875),
>> state 0x10, button 13, same_screen YES
>>
>> 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!
Thanks again,
allan