Emulate left mouse button with CapsLock keyAutoHotkey: problem assigning CAPS LOCK to ALT-TABPressing any key...

Current across a wire with zero potential difference

Why do neural networks need so many training examples to perform?

What game did these black and yellow dice come from?

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

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

After checking in online, how do I know whether I need to go show my passport at airport check-in?

Separate environment for personal and development use under macOS

Bash script to truncate subject line of incoming email

What happened to my GE option?

Count repetitions of an array

How much mayhem could I cause as a fish?

Non-Cancer terminal illness that can affect young (age 10-13) girls?

Why avoid shared user accounts?

What will happen if I transfer large sums of money into my bank account from a pre-paid debit card or gift card?

Is there any risk in sharing info about technologies and products we use with a supplier?

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

A Missing Symbol for This Logo

Decision problem that can be verified but not run in n^2 time

How do you voice extended chords?

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

TikZ graph edges not drawn nicely

What happens when the wearer of a Shield of Missile Attraction is behind total cover?

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

Is a new boolean field better than null reference when a value can be meaningfully absent?



Emulate left mouse button with CapsLock key


AutoHotkey: problem assigning CAPS LOCK to ALT-TABPressing any key stops mouse from working, Backspace acts as “home” (Windows 7, Acer Aspire 5560 MS2319)Emulate middle mouse button with AutoHotKeyHow to emulate hyper key in Windows 10 using autohotkeyAutoHotkey - application loosing focus when enabling full screen modeLet an app have an independent mouse (like vm)How can I simulate the middle mouse button on Linux?How to bind a key to left mouse button perfectly?autohotkeyahk | holding a mouse-button to hold another key?how to bind left/right click to mouse wheel up/down in mac os?













0















I want CapsLock key on my keyboard to act like the left mouse button. I want to be able to perform clicks, double clicks, send mouse down and mouse up events etc.



Now I am using AutoHotkey and the following script



Capslock::LButton
Return


The script works but not in every app and not every time. For example, it doesn't work in Task Manager, it usually doesn't work in installer UIs and some other places.



The script / AutoHotkey also doesn't work in windows of apps under some load. For example, if the app is performing heavy IO then the script might or might not work.



This is annoying to have intermittent issues with the approach.



So, please provide some advice on how to improve the script or maybe recommend some better alternatives than AutoHotkey.










share|improve this question



























    0















    I want CapsLock key on my keyboard to act like the left mouse button. I want to be able to perform clicks, double clicks, send mouse down and mouse up events etc.



    Now I am using AutoHotkey and the following script



    Capslock::LButton
    Return


    The script works but not in every app and not every time. For example, it doesn't work in Task Manager, it usually doesn't work in installer UIs and some other places.



    The script / AutoHotkey also doesn't work in windows of apps under some load. For example, if the app is performing heavy IO then the script might or might not work.



    This is annoying to have intermittent issues with the approach.



    So, please provide some advice on how to improve the script or maybe recommend some better alternatives than AutoHotkey.










    share|improve this question

























      0












      0








      0








      I want CapsLock key on my keyboard to act like the left mouse button. I want to be able to perform clicks, double clicks, send mouse down and mouse up events etc.



      Now I am using AutoHotkey and the following script



      Capslock::LButton
      Return


      The script works but not in every app and not every time. For example, it doesn't work in Task Manager, it usually doesn't work in installer UIs and some other places.



      The script / AutoHotkey also doesn't work in windows of apps under some load. For example, if the app is performing heavy IO then the script might or might not work.



      This is annoying to have intermittent issues with the approach.



      So, please provide some advice on how to improve the script or maybe recommend some better alternatives than AutoHotkey.










      share|improve this question














      I want CapsLock key on my keyboard to act like the left mouse button. I want to be able to perform clicks, double clicks, send mouse down and mouse up events etc.



      Now I am using AutoHotkey and the following script



      Capslock::LButton
      Return


      The script works but not in every app and not every time. For example, it doesn't work in Task Manager, it usually doesn't work in installer UIs and some other places.



      The script / AutoHotkey also doesn't work in windows of apps under some load. For example, if the app is performing heavy IO then the script might or might not work.



      This is annoying to have intermittent issues with the approach.



      So, please provide some advice on how to improve the script or maybe recommend some better alternatives than AutoHotkey.







      keyboard mouse autohotkey remapping






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Jul 30 '15 at 19:16









      BobrovskyBobrovsky

      2922718




      2922718






















          4 Answers
          4






          active

          oldest

          votes


















          1














          The question does not specify the Windowing/Operating system (although one might be tempted to guess...), so for completeness this is the answer in (modern) X11:



          1) find keycode corresponding to CapsLock - e.g. bu running xev and looking for keycode in the output while pressing CapsLock:



          $ xev | grep keycode
          state 0x10, keycode 66 (keysym 0xffe5, Caps_Lock), same_screen YES,
          state 0x12, keycode 66 (keysym 0xffe5, Caps_Lock), same_screen YES,


          If you are using "normal" (i.e. PC) keyboard it should be 66



          2) enable mousekeys:



          $ xkbset m


          3) map the keys you want:



          xmodmap  -e 'keycode 66 = Pointer_Button1'


          or, if you want to be fancy, keep Caps_Lock with some modifier:



          xmodmap  -e 'keycode 66 = Pointer_Button1 Caps_Lock'


          will keep the CapsLock functionality if you press Shift+CapsLock






          share|improve this answer
























          • I appreciate this because I use AHK in that other OS and now wanted the same thing in this OS that uses X11. Only problem is, I actually user my numpad for entering numbers, and this breaks that.

            – Brian Stamper
            1 hour ago



















          0














          For an easy solution, I suggest to set up mouse keys: Control PanelAll Control Panel ItemsEase of Access CenterSet up Mouse Keys



          This will enable to use your keyboard as a mouse by using the numpad area.
          How to use guide.





          If You want to customize it, by altering the keys, than I suggest using NeatMouse.




          NeatMouse has English, French, German, Greek, Italian, Polish and
          Ukrainian translations. Both regular and portable versions are
          available. It is small, convenient, efficient and completely free!







          share|improve this answer
























          • I've had a look at these and Mouse Keys are definitely not something I want because they are not configurable and look like inconvenient for a left hand. NeatMouse probably won't help either. It can't use CapsLock as a left mouse key.

            – Bobrovsky
            Jul 30 '15 at 21:34













          • @Bobrovsky - The description said that it can use them as well. Are You sure CapsLock can not be configured?

            – Divin3
            Jul 30 '15 at 21:40













          • I did try and was unable to do that with NeatMouse.

            – Bobrovsky
            Jul 31 '15 at 15:59











          • @Bobrovsky - there is also a way from the registry to change it: howtogeek.com/howto/windows-vista/… You just need to find the binary code of the left click

            – Divin3
            Jul 31 '15 at 20:07



















          0














          Ok, it turns out there is a hack that enables AutoHotkey to work in Task Manager etc.



          Enable interaction with administrative programs



          Tried that. It worked. So far so good.






          share|improve this answer































            0














            In the spirit of Radovan Garabik's answer (for those of us using an X11 based OS, e.g. Kubuntu .. if you are using Windows this is not for you, stick with the AutoHotKey solutions.) I got this to work without disabling my numpad by doing this:



            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. (You may need to install xbindkeys, on Debian/Ubuntu that is sudo apt install xbindkeys.)



            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: "3"
              };
              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%2fsuperuser.com%2fquestions%2f947807%2femulate-left-mouse-button-with-capslock-key%23new-answer', 'question_page');
              }
              );

              Post as a guest















              Required, but never shown

























              4 Answers
              4






              active

              oldest

              votes








              4 Answers
              4






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes









              1














              The question does not specify the Windowing/Operating system (although one might be tempted to guess...), so for completeness this is the answer in (modern) X11:



              1) find keycode corresponding to CapsLock - e.g. bu running xev and looking for keycode in the output while pressing CapsLock:



              $ xev | grep keycode
              state 0x10, keycode 66 (keysym 0xffe5, Caps_Lock), same_screen YES,
              state 0x12, keycode 66 (keysym 0xffe5, Caps_Lock), same_screen YES,


              If you are using "normal" (i.e. PC) keyboard it should be 66



              2) enable mousekeys:



              $ xkbset m


              3) map the keys you want:



              xmodmap  -e 'keycode 66 = Pointer_Button1'


              or, if you want to be fancy, keep Caps_Lock with some modifier:



              xmodmap  -e 'keycode 66 = Pointer_Button1 Caps_Lock'


              will keep the CapsLock functionality if you press Shift+CapsLock






              share|improve this answer
























              • I appreciate this because I use AHK in that other OS and now wanted the same thing in this OS that uses X11. Only problem is, I actually user my numpad for entering numbers, and this breaks that.

                – Brian Stamper
                1 hour ago
















              1














              The question does not specify the Windowing/Operating system (although one might be tempted to guess...), so for completeness this is the answer in (modern) X11:



              1) find keycode corresponding to CapsLock - e.g. bu running xev and looking for keycode in the output while pressing CapsLock:



              $ xev | grep keycode
              state 0x10, keycode 66 (keysym 0xffe5, Caps_Lock), same_screen YES,
              state 0x12, keycode 66 (keysym 0xffe5, Caps_Lock), same_screen YES,


              If you are using "normal" (i.e. PC) keyboard it should be 66



              2) enable mousekeys:



              $ xkbset m


              3) map the keys you want:



              xmodmap  -e 'keycode 66 = Pointer_Button1'


              or, if you want to be fancy, keep Caps_Lock with some modifier:



              xmodmap  -e 'keycode 66 = Pointer_Button1 Caps_Lock'


              will keep the CapsLock functionality if you press Shift+CapsLock






              share|improve this answer
























              • I appreciate this because I use AHK in that other OS and now wanted the same thing in this OS that uses X11. Only problem is, I actually user my numpad for entering numbers, and this breaks that.

                – Brian Stamper
                1 hour ago














              1












              1








              1







              The question does not specify the Windowing/Operating system (although one might be tempted to guess...), so for completeness this is the answer in (modern) X11:



              1) find keycode corresponding to CapsLock - e.g. bu running xev and looking for keycode in the output while pressing CapsLock:



              $ xev | grep keycode
              state 0x10, keycode 66 (keysym 0xffe5, Caps_Lock), same_screen YES,
              state 0x12, keycode 66 (keysym 0xffe5, Caps_Lock), same_screen YES,


              If you are using "normal" (i.e. PC) keyboard it should be 66



              2) enable mousekeys:



              $ xkbset m


              3) map the keys you want:



              xmodmap  -e 'keycode 66 = Pointer_Button1'


              or, if you want to be fancy, keep Caps_Lock with some modifier:



              xmodmap  -e 'keycode 66 = Pointer_Button1 Caps_Lock'


              will keep the CapsLock functionality if you press Shift+CapsLock






              share|improve this answer













              The question does not specify the Windowing/Operating system (although one might be tempted to guess...), so for completeness this is the answer in (modern) X11:



              1) find keycode corresponding to CapsLock - e.g. bu running xev and looking for keycode in the output while pressing CapsLock:



              $ xev | grep keycode
              state 0x10, keycode 66 (keysym 0xffe5, Caps_Lock), same_screen YES,
              state 0x12, keycode 66 (keysym 0xffe5, Caps_Lock), same_screen YES,


              If you are using "normal" (i.e. PC) keyboard it should be 66



              2) enable mousekeys:



              $ xkbset m


              3) map the keys you want:



              xmodmap  -e 'keycode 66 = Pointer_Button1'


              or, if you want to be fancy, keep Caps_Lock with some modifier:



              xmodmap  -e 'keycode 66 = Pointer_Button1 Caps_Lock'


              will keep the CapsLock functionality if you press Shift+CapsLock







              share|improve this answer












              share|improve this answer



              share|improve this answer










              answered Oct 30 '17 at 16:06









              Radovan GarabíkRadovan Garabík

              33114




              33114













              • I appreciate this because I use AHK in that other OS and now wanted the same thing in this OS that uses X11. Only problem is, I actually user my numpad for entering numbers, and this breaks that.

                – Brian Stamper
                1 hour ago



















              • I appreciate this because I use AHK in that other OS and now wanted the same thing in this OS that uses X11. Only problem is, I actually user my numpad for entering numbers, and this breaks that.

                – Brian Stamper
                1 hour ago

















              I appreciate this because I use AHK in that other OS and now wanted the same thing in this OS that uses X11. Only problem is, I actually user my numpad for entering numbers, and this breaks that.

              – Brian Stamper
              1 hour ago





              I appreciate this because I use AHK in that other OS and now wanted the same thing in this OS that uses X11. Only problem is, I actually user my numpad for entering numbers, and this breaks that.

              – Brian Stamper
              1 hour ago













              0














              For an easy solution, I suggest to set up mouse keys: Control PanelAll Control Panel ItemsEase of Access CenterSet up Mouse Keys



              This will enable to use your keyboard as a mouse by using the numpad area.
              How to use guide.





              If You want to customize it, by altering the keys, than I suggest using NeatMouse.




              NeatMouse has English, French, German, Greek, Italian, Polish and
              Ukrainian translations. Both regular and portable versions are
              available. It is small, convenient, efficient and completely free!







              share|improve this answer
























              • I've had a look at these and Mouse Keys are definitely not something I want because they are not configurable and look like inconvenient for a left hand. NeatMouse probably won't help either. It can't use CapsLock as a left mouse key.

                – Bobrovsky
                Jul 30 '15 at 21:34













              • @Bobrovsky - The description said that it can use them as well. Are You sure CapsLock can not be configured?

                – Divin3
                Jul 30 '15 at 21:40













              • I did try and was unable to do that with NeatMouse.

                – Bobrovsky
                Jul 31 '15 at 15:59











              • @Bobrovsky - there is also a way from the registry to change it: howtogeek.com/howto/windows-vista/… You just need to find the binary code of the left click

                – Divin3
                Jul 31 '15 at 20:07
















              0














              For an easy solution, I suggest to set up mouse keys: Control PanelAll Control Panel ItemsEase of Access CenterSet up Mouse Keys



              This will enable to use your keyboard as a mouse by using the numpad area.
              How to use guide.





              If You want to customize it, by altering the keys, than I suggest using NeatMouse.




              NeatMouse has English, French, German, Greek, Italian, Polish and
              Ukrainian translations. Both regular and portable versions are
              available. It is small, convenient, efficient and completely free!







              share|improve this answer
























              • I've had a look at these and Mouse Keys are definitely not something I want because they are not configurable and look like inconvenient for a left hand. NeatMouse probably won't help either. It can't use CapsLock as a left mouse key.

                – Bobrovsky
                Jul 30 '15 at 21:34













              • @Bobrovsky - The description said that it can use them as well. Are You sure CapsLock can not be configured?

                – Divin3
                Jul 30 '15 at 21:40













              • I did try and was unable to do that with NeatMouse.

                – Bobrovsky
                Jul 31 '15 at 15:59











              • @Bobrovsky - there is also a way from the registry to change it: howtogeek.com/howto/windows-vista/… You just need to find the binary code of the left click

                – Divin3
                Jul 31 '15 at 20:07














              0












              0








              0







              For an easy solution, I suggest to set up mouse keys: Control PanelAll Control Panel ItemsEase of Access CenterSet up Mouse Keys



              This will enable to use your keyboard as a mouse by using the numpad area.
              How to use guide.





              If You want to customize it, by altering the keys, than I suggest using NeatMouse.




              NeatMouse has English, French, German, Greek, Italian, Polish and
              Ukrainian translations. Both regular and portable versions are
              available. It is small, convenient, efficient and completely free!







              share|improve this answer













              For an easy solution, I suggest to set up mouse keys: Control PanelAll Control Panel ItemsEase of Access CenterSet up Mouse Keys



              This will enable to use your keyboard as a mouse by using the numpad area.
              How to use guide.





              If You want to customize it, by altering the keys, than I suggest using NeatMouse.




              NeatMouse has English, French, German, Greek, Italian, Polish and
              Ukrainian translations. Both regular and portable versions are
              available. It is small, convenient, efficient and completely free!








              share|improve this answer












              share|improve this answer



              share|improve this answer










              answered Jul 30 '15 at 21:25









              Divin3Divin3

              1,4281726




              1,4281726













              • I've had a look at these and Mouse Keys are definitely not something I want because they are not configurable and look like inconvenient for a left hand. NeatMouse probably won't help either. It can't use CapsLock as a left mouse key.

                – Bobrovsky
                Jul 30 '15 at 21:34













              • @Bobrovsky - The description said that it can use them as well. Are You sure CapsLock can not be configured?

                – Divin3
                Jul 30 '15 at 21:40













              • I did try and was unable to do that with NeatMouse.

                – Bobrovsky
                Jul 31 '15 at 15:59











              • @Bobrovsky - there is also a way from the registry to change it: howtogeek.com/howto/windows-vista/… You just need to find the binary code of the left click

                – Divin3
                Jul 31 '15 at 20:07



















              • I've had a look at these and Mouse Keys are definitely not something I want because they are not configurable and look like inconvenient for a left hand. NeatMouse probably won't help either. It can't use CapsLock as a left mouse key.

                – Bobrovsky
                Jul 30 '15 at 21:34













              • @Bobrovsky - The description said that it can use them as well. Are You sure CapsLock can not be configured?

                – Divin3
                Jul 30 '15 at 21:40













              • I did try and was unable to do that with NeatMouse.

                – Bobrovsky
                Jul 31 '15 at 15:59











              • @Bobrovsky - there is also a way from the registry to change it: howtogeek.com/howto/windows-vista/… You just need to find the binary code of the left click

                – Divin3
                Jul 31 '15 at 20:07

















              I've had a look at these and Mouse Keys are definitely not something I want because they are not configurable and look like inconvenient for a left hand. NeatMouse probably won't help either. It can't use CapsLock as a left mouse key.

              – Bobrovsky
              Jul 30 '15 at 21:34







              I've had a look at these and Mouse Keys are definitely not something I want because they are not configurable and look like inconvenient for a left hand. NeatMouse probably won't help either. It can't use CapsLock as a left mouse key.

              – Bobrovsky
              Jul 30 '15 at 21:34















              @Bobrovsky - The description said that it can use them as well. Are You sure CapsLock can not be configured?

              – Divin3
              Jul 30 '15 at 21:40







              @Bobrovsky - The description said that it can use them as well. Are You sure CapsLock can not be configured?

              – Divin3
              Jul 30 '15 at 21:40















              I did try and was unable to do that with NeatMouse.

              – Bobrovsky
              Jul 31 '15 at 15:59





              I did try and was unable to do that with NeatMouse.

              – Bobrovsky
              Jul 31 '15 at 15:59













              @Bobrovsky - there is also a way from the registry to change it: howtogeek.com/howto/windows-vista/… You just need to find the binary code of the left click

              – Divin3
              Jul 31 '15 at 20:07





              @Bobrovsky - there is also a way from the registry to change it: howtogeek.com/howto/windows-vista/… You just need to find the binary code of the left click

              – Divin3
              Jul 31 '15 at 20:07











              0














              Ok, it turns out there is a hack that enables AutoHotkey to work in Task Manager etc.



              Enable interaction with administrative programs



              Tried that. It worked. So far so good.






              share|improve this answer




























                0














                Ok, it turns out there is a hack that enables AutoHotkey to work in Task Manager etc.



                Enable interaction with administrative programs



                Tried that. It worked. So far so good.






                share|improve this answer


























                  0












                  0








                  0







                  Ok, it turns out there is a hack that enables AutoHotkey to work in Task Manager etc.



                  Enable interaction with administrative programs



                  Tried that. It worked. So far so good.






                  share|improve this answer













                  Ok, it turns out there is a hack that enables AutoHotkey to work in Task Manager etc.



                  Enable interaction with administrative programs



                  Tried that. It worked. So far so good.







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Aug 1 '15 at 14:47









                  BobrovskyBobrovsky

                  2922718




                  2922718























                      0














                      In the spirit of Radovan Garabik's answer (for those of us using an X11 based OS, e.g. Kubuntu .. if you are using Windows this is not for you, stick with the AutoHotKey solutions.) I got this to work without disabling my numpad by doing this:



                      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. (You may need to install xbindkeys, on Debian/Ubuntu that is sudo apt install xbindkeys.)



                      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














                        In the spirit of Radovan Garabik's answer (for those of us using an X11 based OS, e.g. Kubuntu .. if you are using Windows this is not for you, stick with the AutoHotKey solutions.) I got this to work without disabling my numpad by doing this:



                        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. (You may need to install xbindkeys, on Debian/Ubuntu that is sudo apt install xbindkeys.)



                        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







                          In the spirit of Radovan Garabik's answer (for those of us using an X11 based OS, e.g. Kubuntu .. if you are using Windows this is not for you, stick with the AutoHotKey solutions.) I got this to work without disabling my numpad by doing this:



                          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. (You may need to install xbindkeys, on Debian/Ubuntu that is sudo apt install xbindkeys.)



                          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.










                          In the spirit of Radovan Garabik's answer (for those of us using an X11 based OS, e.g. Kubuntu .. if you are using Windows this is not for you, stick with the AutoHotKey solutions.) I got this to work without disabling my numpad by doing this:



                          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. (You may need to install xbindkeys, on Debian/Ubuntu that is sudo apt install xbindkeys.)



                          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








                          edited 2 mins ago





















                          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 7 mins ago









                          Brian StamperBrian Stamper

                          1011




                          1011




                          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 Super User!


                              • 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%2fsuperuser.com%2fquestions%2f947807%2femulate-left-mouse-button-with-capslock-key%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 not use the yoke to control yaw, as well as pitch and roll? Announcing the arrival of...

                              Couldn't open a raw socket. Error: Permission denied (13) (nmap)Is it possible to run networking commands...

                              VNC viewer RFB protocol error: bad desktop size 0x0I Cannot Type the Key 'd' (lowercase) in VNC Viewer...