LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   swap button 2 and button 3 in xterm and terminal only? (http://www.linuxquestions.org/questions/linux-software-2/swap-button-2-and-button-3-in-xterm-and-terminal-only-757859/)

senjak 09-26-2009 01:21 AM

swap button 2 and button 3 in xterm and terminal only?
 
Hello!

Long ago I remember actually seeing a thread somewhere that actually answered the question; however, I haven't had any luck finding the answer lately.

Looking for what file I need to modify, along with the lines necessary in order to swap buttons two and three in xterm and terminal only. I'm running a vary vanilla Ubuntu with the default gnome window manager.

Thanks for any help you can give.

Senjak

slakmagik 09-26-2009 06:48 PM

Not sure about the terminal - probably something with xkb - as far as xterm, you can do something like the following in ~/.xresources (or whatever your file is called):

Code:

XTerm*VT100.translations: #override\
              !Ctrl <Btn2Down>:popup-menu(vtMenu) \n\
          !Lock Ctrl <Btn2Down>:popup-menu(vtMenu) \n\
!Lock Ctrl @Num_Lock <Btn2Down>:popup-menu(vtMenu) \n\
    ! @Num_Lock Ctrl <Btn2Down>:popup-menu(vtMenu) \n\
        ~Ctrl ~Meta <Btn2Down>:ignore() \n\
                Meta <Btn2Down>:clear-saved-lines() \n\
          ~Ctrl ~Meta <Btn2Up>:insert-selection(SELECT, CUT_BUFFER0) \n\
              !Ctrl <Btn3Down>:popup-menu(fontMenu) \n\
          !Lock Ctrl <Btn3Down>:popup-menu(fontMenu) \n\
!Lock Ctrl @Num_Lock <Btn3Down>:popup-menu(fontMenu) \n\
    ! @Num_Lock Ctrl <Btn3Down>:popup-menu(fontMenu) \n\
        ~Ctrl ~Meta <Btn3Down>:start-extend() \n\
            ~Meta <Btn3Motion>:select-extend()

except switch Btn2 and Btn3. The xterm manual has the complete translation table and there might even be an easier way to directly switch the buttons. The easiest way would be with xmodmap, but that would do it for all apps. Not even going to ask why you want this. ;)

senjak 09-26-2009 11:34 PM

Thanks, that gives me a good place to start.

As to why,

Button 2 on my mouse is under the wheel. Getting it to click can be annoying.

Thanks for the assistance!

Senjak


All times are GMT -5. The time now is 10:53 AM.