Map caps-lock key to middle mouse clickHow do I remap certain keys or devices?Extra Mouse button assigned to...

What is a DAG (Graph Theory)?

TikZ graph edges not drawn nicely

What happens when I Twin Life Transference?

Separate environment for personal and development use under macOS

How to make ice magic work from a scientific point of view?

A Missing Symbol for This Logo

Play Zip, Zap, Zop

What is the wife of a henpecked husband called?

Existence of Riemann surface, holomorphic maps

Boss asked me to sign a resignation paper without a date on it along with my new contract

Plausible reason for gold-digging ant

Short story where statues have their heads replaced by those of carved insect heads

Why did Democrats in the Senate oppose the Born-Alive Abortion Survivors Protection Act (2019 S.130)?

What is a good reason for every spaceship to carry a weapon on board?

How do you funnel food off a cutting board?

Am I a Rude Number?

Saint abbreviation

A starship is travelling at 0.9c and collides with a small rock. Will it leave a clean hole through, or will more happen?

Strange "DuckDuckGo dork" takes me to random website

How to not let the Identify spell spoil everything?

How much mayhem could I cause as a fish?

Why did Luke use his left hand to shoot?

How to deal with possible delayed baggage?

Why didn't Tom Riddle take the presence of Fawkes and the Sorting Hat as more of a threat?



Map caps-lock key to middle mouse click


How do I remap certain keys or devices?Extra Mouse button assigned to Super-W short cutRemap Caps Lock key to 'Run Command' (Alt+F2)Can I bind the Unity dock to the Caps Lock key?After swapping Ctrl and caps in xmodmap, how can I make Ctrl work properly for multi-modifier combinations?How do I map a key to middle click?Map Double Click to Key CombinationMap Caps key to Super+Alt+Ctrl?Use Caps Lock as arbitrary shortcut key in KDE5How do I remap the caps lock key to the backspace key?How to use both mouse buttons simultaneously as middle-click?Map the Caps Lock key to the Super L key













11















Since I rarely use caps-lock, I'd like to map the key to a middle mouse click instead. I would also like to map Alt+Caps Lock to the original function of the caps lock key, should I ever need it.



I can map any keyboard shortcut to xdotool click 2, but the Gnome Keyboard Shortcuts dialog won't let me assign a command to the caps-lock key, even with modifiers.



I know this is a bit of a strange undertaking; How would I go about doing it?










share|improve this question





























    11















    Since I rarely use caps-lock, I'd like to map the key to a middle mouse click instead. I would also like to map Alt+Caps Lock to the original function of the caps lock key, should I ever need it.



    I can map any keyboard shortcut to xdotool click 2, but the Gnome Keyboard Shortcuts dialog won't let me assign a command to the caps-lock key, even with modifiers.



    I know this is a bit of a strange undertaking; How would I go about doing it?










    share|improve this question



























      11












      11








      11


      3






      Since I rarely use caps-lock, I'd like to map the key to a middle mouse click instead. I would also like to map Alt+Caps Lock to the original function of the caps lock key, should I ever need it.



      I can map any keyboard shortcut to xdotool click 2, but the Gnome Keyboard Shortcuts dialog won't let me assign a command to the caps-lock key, even with modifiers.



      I know this is a bit of a strange undertaking; How would I go about doing it?










      share|improve this question
















      Since I rarely use caps-lock, I'd like to map the key to a middle mouse click instead. I would also like to map Alt+Caps Lock to the original function of the caps lock key, should I ever need it.



      I can map any keyboard shortcut to xdotool click 2, but the Gnome Keyboard Shortcuts dialog won't let me assign a command to the caps-lock key, even with modifiers.



      I know this is a bit of a strange undertaking; How would I go about doing it?







      xorg keyboard shortcut-keys input-devices xmodmap






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Feb 26 '11 at 4:11









      Erigami

      3,72232042




      3,72232042










      asked Dec 14 '10 at 7:04









      Stefano PalazzoStefano Palazzo

      63.4k33183216




      63.4k33183216






















          3 Answers
          3






          active

          oldest

          votes


















          4














          If you first remove the lock modifier from the Caps Lock key you should then be able to assign the key in Keyboard Shortcuts, use the command below to do that:



          echo  'remove lock = Caps_Lock' | xmodmap -





          share|improve this answer
























          • very good! any chance to get caps lock back onto alt+capslock?

            – Stefano Palazzo
            Dec 18 '10 at 16:36



















          2














          Another easy solution if you prefer to use a GUI is to install easystroke:



          sudo apt-get install easystroke


          You can easily map keyboard keys and shortcuts to mouse buttons as well as mouse gestures.






          share|improve this answer

































            0














            Old question, new answer, copying myself from here:
            https://superuser.com/questions/947807/emulate-left-mouse-button-with-capslock-key/1409757#1409757



            I was looking for CapsLock = left click, should be similar. I believe only difference is in the line "xte 'mouseclick 1'" change to "xte 'mouseclick 2'".



            This requires the xbindkeys and xautomation packages installed on your system.



            In my ~/.bashrc (or whatever startup script is appropriate to your system) I added these lines:



            /usr/bin/xmodmap -e "remove lock = Caps_Lock"
            /usr/bin/xmodmap -e "keycode 66 ="
            /usr/bin/xbindkeys -f ~/.xbindkeysrc


            This apparently removes the 'locking' behavior of Caps Lock and assigns that key (key 66) to nothingness. Then it lets xbindkeys assign the behavior we want.



            For that I created the file ~/.xbindkeysrc with these lines:



            "xte 'mouseclick 1'"
            c:66


            A reboot or running source ~/.bashrc should make it work. If you are tinkering with xbindkeys and need to reload it, try this:



            killall xbindkeys
            xbindkeys -f ~/.xbindkeysrc




            share








            New contributor




            Brian Stamper is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
            Check out our Code of Conduct.




















              Your Answer








              StackExchange.ready(function() {
              var channelOptions = {
              tags: "".split(" "),
              id: "89"
              };
              initTagRenderer("".split(" "), "".split(" "), channelOptions);

              StackExchange.using("externalEditor", function() {
              // Have to fire editor after snippets, if snippets enabled
              if (StackExchange.settings.snippets.snippetsEnabled) {
              StackExchange.using("snippets", function() {
              createEditor();
              });
              }
              else {
              createEditor();
              }
              });

              function createEditor() {
              StackExchange.prepareEditor({
              heartbeatType: 'answer',
              autoActivateHeartbeat: false,
              convertImagesToLinks: true,
              noModals: true,
              showLowRepImageUploadWarning: true,
              reputationToPostImages: 10,
              bindNavPrevention: true,
              postfix: "",
              imageUploader: {
              brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
              contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
              allowUrls: true
              },
              onDemand: true,
              discardSelector: ".discard-answer"
              ,immediatelyShowMarkdownHelp:true
              });


              }
              });














              draft saved

              draft discarded


















              StackExchange.ready(
              function () {
              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f17294%2fmap-caps-lock-key-to-middle-mouse-click%23new-answer', 'question_page');
              }
              );

              Post as a guest















              Required, but never shown

























              3 Answers
              3






              active

              oldest

              votes








              3 Answers
              3






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes









              4














              If you first remove the lock modifier from the Caps Lock key you should then be able to assign the key in Keyboard Shortcuts, use the command below to do that:



              echo  'remove lock = Caps_Lock' | xmodmap -





              share|improve this answer
























              • very good! any chance to get caps lock back onto alt+capslock?

                – Stefano Palazzo
                Dec 18 '10 at 16:36
















              4














              If you first remove the lock modifier from the Caps Lock key you should then be able to assign the key in Keyboard Shortcuts, use the command below to do that:



              echo  'remove lock = Caps_Lock' | xmodmap -





              share|improve this answer
























              • very good! any chance to get caps lock back onto alt+capslock?

                – Stefano Palazzo
                Dec 18 '10 at 16:36














              4












              4








              4







              If you first remove the lock modifier from the Caps Lock key you should then be able to assign the key in Keyboard Shortcuts, use the command below to do that:



              echo  'remove lock = Caps_Lock' | xmodmap -





              share|improve this answer













              If you first remove the lock modifier from the Caps Lock key you should then be able to assign the key in Keyboard Shortcuts, use the command below to do that:



              echo  'remove lock = Caps_Lock' | xmodmap -






              share|improve this answer












              share|improve this answer



              share|improve this answer










              answered Dec 18 '10 at 1:05









              AndyAndy

              727314




              727314













              • very good! any chance to get caps lock back onto alt+capslock?

                – Stefano Palazzo
                Dec 18 '10 at 16:36



















              • very good! any chance to get caps lock back onto alt+capslock?

                – Stefano Palazzo
                Dec 18 '10 at 16:36

















              very good! any chance to get caps lock back onto alt+capslock?

              – Stefano Palazzo
              Dec 18 '10 at 16:36





              very good! any chance to get caps lock back onto alt+capslock?

              – Stefano Palazzo
              Dec 18 '10 at 16:36













              2














              Another easy solution if you prefer to use a GUI is to install easystroke:



              sudo apt-get install easystroke


              You can easily map keyboard keys and shortcuts to mouse buttons as well as mouse gestures.






              share|improve this answer






























                2














                Another easy solution if you prefer to use a GUI is to install easystroke:



                sudo apt-get install easystroke


                You can easily map keyboard keys and shortcuts to mouse buttons as well as mouse gestures.






                share|improve this answer




























                  2












                  2








                  2







                  Another easy solution if you prefer to use a GUI is to install easystroke:



                  sudo apt-get install easystroke


                  You can easily map keyboard keys and shortcuts to mouse buttons as well as mouse gestures.






                  share|improve this answer















                  Another easy solution if you prefer to use a GUI is to install easystroke:



                  sudo apt-get install easystroke


                  You can easily map keyboard keys and shortcuts to mouse buttons as well as mouse gestures.







                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited Feb 14 '17 at 9:45









                  Zanna

                  50.9k13136241




                  50.9k13136241










                  answered Jul 13 '12 at 15:07









                  user76179user76179

                  191




                  191























                      0














                      Old question, new answer, copying myself from here:
                      https://superuser.com/questions/947807/emulate-left-mouse-button-with-capslock-key/1409757#1409757



                      I was looking for CapsLock = left click, should be similar. I believe only difference is in the line "xte 'mouseclick 1'" change to "xte 'mouseclick 2'".



                      This requires the xbindkeys and xautomation packages installed on your system.



                      In my ~/.bashrc (or whatever startup script is appropriate to your system) I added these lines:



                      /usr/bin/xmodmap -e "remove lock = Caps_Lock"
                      /usr/bin/xmodmap -e "keycode 66 ="
                      /usr/bin/xbindkeys -f ~/.xbindkeysrc


                      This apparently removes the 'locking' behavior of Caps Lock and assigns that key (key 66) to nothingness. Then it lets xbindkeys assign the behavior we want.



                      For that I created the file ~/.xbindkeysrc with these lines:



                      "xte 'mouseclick 1'"
                      c:66


                      A reboot or running source ~/.bashrc should make it work. If you are tinkering with xbindkeys and need to reload it, try this:



                      killall xbindkeys
                      xbindkeys -f ~/.xbindkeysrc




                      share








                      New contributor




                      Brian Stamper is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                      Check out our Code of Conduct.

























                        0














                        Old question, new answer, copying myself from here:
                        https://superuser.com/questions/947807/emulate-left-mouse-button-with-capslock-key/1409757#1409757



                        I was looking for CapsLock = left click, should be similar. I believe only difference is in the line "xte 'mouseclick 1'" change to "xte 'mouseclick 2'".



                        This requires the xbindkeys and xautomation packages installed on your system.



                        In my ~/.bashrc (or whatever startup script is appropriate to your system) I added these lines:



                        /usr/bin/xmodmap -e "remove lock = Caps_Lock"
                        /usr/bin/xmodmap -e "keycode 66 ="
                        /usr/bin/xbindkeys -f ~/.xbindkeysrc


                        This apparently removes the 'locking' behavior of Caps Lock and assigns that key (key 66) to nothingness. Then it lets xbindkeys assign the behavior we want.



                        For that I created the file ~/.xbindkeysrc with these lines:



                        "xte 'mouseclick 1'"
                        c:66


                        A reboot or running source ~/.bashrc should make it work. If you are tinkering with xbindkeys and need to reload it, try this:



                        killall xbindkeys
                        xbindkeys -f ~/.xbindkeysrc




                        share








                        New contributor




                        Brian Stamper is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                        Check out our Code of Conduct.























                          0












                          0








                          0







                          Old question, new answer, copying myself from here:
                          https://superuser.com/questions/947807/emulate-left-mouse-button-with-capslock-key/1409757#1409757



                          I was looking for CapsLock = left click, should be similar. I believe only difference is in the line "xte 'mouseclick 1'" change to "xte 'mouseclick 2'".



                          This requires the xbindkeys and xautomation packages installed on your system.



                          In my ~/.bashrc (or whatever startup script is appropriate to your system) I added these lines:



                          /usr/bin/xmodmap -e "remove lock = Caps_Lock"
                          /usr/bin/xmodmap -e "keycode 66 ="
                          /usr/bin/xbindkeys -f ~/.xbindkeysrc


                          This apparently removes the 'locking' behavior of Caps Lock and assigns that key (key 66) to nothingness. Then it lets xbindkeys assign the behavior we want.



                          For that I created the file ~/.xbindkeysrc with these lines:



                          "xte 'mouseclick 1'"
                          c:66


                          A reboot or running source ~/.bashrc should make it work. If you are tinkering with xbindkeys and need to reload it, try this:



                          killall xbindkeys
                          xbindkeys -f ~/.xbindkeysrc




                          share








                          New contributor




                          Brian Stamper is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                          Check out our Code of Conduct.










                          Old question, new answer, copying myself from here:
                          https://superuser.com/questions/947807/emulate-left-mouse-button-with-capslock-key/1409757#1409757



                          I was looking for CapsLock = left click, should be similar. I believe only difference is in the line "xte 'mouseclick 1'" change to "xte 'mouseclick 2'".



                          This requires the xbindkeys and xautomation packages installed on your system.



                          In my ~/.bashrc (or whatever startup script is appropriate to your system) I added these lines:



                          /usr/bin/xmodmap -e "remove lock = Caps_Lock"
                          /usr/bin/xmodmap -e "keycode 66 ="
                          /usr/bin/xbindkeys -f ~/.xbindkeysrc


                          This apparently removes the 'locking' behavior of Caps Lock and assigns that key (key 66) to nothingness. Then it lets xbindkeys assign the behavior we want.



                          For that I created the file ~/.xbindkeysrc with these lines:



                          "xte 'mouseclick 1'"
                          c:66


                          A reboot or running source ~/.bashrc should make it work. If you are tinkering with xbindkeys and need to reload it, try this:



                          killall xbindkeys
                          xbindkeys -f ~/.xbindkeysrc





                          share








                          New contributor




                          Brian Stamper is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                          Check out our Code of Conduct.








                          share


                          share






                          New contributor




                          Brian Stamper is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                          Check out our Code of Conduct.









                          answered 6 mins ago









                          Brian StamperBrian Stamper

                          101




                          101




                          New contributor




                          Brian Stamper is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                          Check out our Code of Conduct.





                          New contributor





                          Brian Stamper is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                          Check out our Code of Conduct.






                          Brian Stamper is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                          Check out our Code of Conduct.






























                              draft saved

                              draft discarded




















































                              Thanks for contributing an answer to Ask Ubuntu!


                              • Please be sure to answer the question. Provide details and share your research!

                              But avoid



                              • Asking for help, clarification, or responding to other answers.

                              • Making statements based on opinion; back them up with references or personal experience.


                              To learn more, see our tips on writing great answers.




                              draft saved


                              draft discarded














                              StackExchange.ready(
                              function () {
                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f17294%2fmap-caps-lock-key-to-middle-mouse-click%23new-answer', 'question_page');
                              }
                              );

                              Post as a guest















                              Required, but never shown





















































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown

































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown







                              Popular posts from this blog

                              Why do type traits not work with types in namespace scope?What are POD types in C++?Why can templates only be...

                              Will tsunami waves travel forever if there was no land?Why do tsunami waves begin with the water flowing away...

                              Simple Scan not detecting my scanner (Brother DCP-7055W)Brother MFC-L2700DW printer can print, can't...