[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: |
Mon, 27 Aug 2018 17:13:12 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) |
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