Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 09-26-2009, 01:21 AM   #1
LQ Newbie
Registered: Sep 2008
Location: New Hope, MN
Distribution: debian
Posts: 9

Rep: Reputation: 0
Question swap button 2 and button 3 in xterm and terminal only?


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.

Old 09-26-2009, 06:48 PM   #2
Senior Member
Registered: Feb 2003
Distribution: Slackware
Posts: 4,113

Rep: Reputation: Disabled
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):

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.
Old 09-26-2009, 11:34 PM   #3
LQ Newbie
Registered: Sep 2008
Location: New Hope, MN
Distribution: debian
Posts: 9

Original Poster
Rep: Reputation: 0
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!



button, xterm

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
problem with gnome's shut down button (red button) alaios Ubuntu 1 09-10-2008 04:25 PM
Mutlipe text/button form, one submit button bappreacher Programming 8 06-27-2006 08:07 AM
make thumb button/third button double-click taboom Linux - Hardware 0 03-20-2006 02:39 PM
Vector 5.1 SOHO. Start button/K button, Sound card suseforge VectorLinux 0 01-30-2006 12:14 PM
Xterm: how to use right mouse button for scrollbar beforewisdom Linux - Software 0 06-22-2003 07:57 AM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:37 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration