Using CapsLock as a Function key

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite












I want to do 2 things:



  1. Disable CapsLock key so that pressing it doesn't toggle CapsLock.

  2. Be able to set up custom combinations with CapsLock like:


    • CapsLock + j to map to Down key


    • CapsLock + k to map to Up key


I don't want to swap CapsLock with Ctrl or Win or any other modifier key. I want to be able to use CapsLock as an additional modifier key.



I've explored xmodmap, xbindkeys, xte and it has been hit or miss, sometimes it works and sometimes it doesn't. At this point I'm happy to even write my own custom keyboard driver if that will allow me to do this, but I'm just frustrated at the lack of ability to do such a simple thing in Linux.



In Windows, I can do the same simply with Autohotkey and the following lines in a script:



; Turn off caps lock so it doesn't get pressed accidentally.
SetCapsLockState, AlwaysOff
CapsLock & k::Up
CapsLock & j::Down
CapsLock & h::Left
CapsLock & l::Right









share|improve this question



















  • 2




    Possible duplicate of How to prevent the caps-lock toggle effect, without remapping or disabling it?
    – Ipor Sircer
    Dec 4 at 3:36






  • 1




    Thanks for the link. But it seems to answer only the first part of disabling capslock, doesn't explain how to set up custom keyboard combos with capslock.
    – Plasty Grove
    Dec 4 at 3:44










  • You've already know it: xbindkeys.
    – Ipor Sircer
    Dec 4 at 4:03










  • @IporSircer if it's that easy why don't you just give a simple working example? If I'm not mistaken, xbindkeys works by grabbing keys, which are causing spurious FocusOut/FocusIn+NotifyGrab events which are confusing the hell out of many apps.
    – mosvy
    Dec 4 at 4:18










  • Because he used windows-related code on a unix-only site.
    – Ipor Sircer
    Dec 4 at 4:21















up vote
0
down vote

favorite












I want to do 2 things:



  1. Disable CapsLock key so that pressing it doesn't toggle CapsLock.

  2. Be able to set up custom combinations with CapsLock like:


    • CapsLock + j to map to Down key


    • CapsLock + k to map to Up key


I don't want to swap CapsLock with Ctrl or Win or any other modifier key. I want to be able to use CapsLock as an additional modifier key.



I've explored xmodmap, xbindkeys, xte and it has been hit or miss, sometimes it works and sometimes it doesn't. At this point I'm happy to even write my own custom keyboard driver if that will allow me to do this, but I'm just frustrated at the lack of ability to do such a simple thing in Linux.



In Windows, I can do the same simply with Autohotkey and the following lines in a script:



; Turn off caps lock so it doesn't get pressed accidentally.
SetCapsLockState, AlwaysOff
CapsLock & k::Up
CapsLock & j::Down
CapsLock & h::Left
CapsLock & l::Right









share|improve this question



















  • 2




    Possible duplicate of How to prevent the caps-lock toggle effect, without remapping or disabling it?
    – Ipor Sircer
    Dec 4 at 3:36






  • 1




    Thanks for the link. But it seems to answer only the first part of disabling capslock, doesn't explain how to set up custom keyboard combos with capslock.
    – Plasty Grove
    Dec 4 at 3:44










  • You've already know it: xbindkeys.
    – Ipor Sircer
    Dec 4 at 4:03










  • @IporSircer if it's that easy why don't you just give a simple working example? If I'm not mistaken, xbindkeys works by grabbing keys, which are causing spurious FocusOut/FocusIn+NotifyGrab events which are confusing the hell out of many apps.
    – mosvy
    Dec 4 at 4:18










  • Because he used windows-related code on a unix-only site.
    – Ipor Sircer
    Dec 4 at 4:21













up vote
0
down vote

favorite









up vote
0
down vote

favorite











I want to do 2 things:



  1. Disable CapsLock key so that pressing it doesn't toggle CapsLock.

  2. Be able to set up custom combinations with CapsLock like:


    • CapsLock + j to map to Down key


    • CapsLock + k to map to Up key


I don't want to swap CapsLock with Ctrl or Win or any other modifier key. I want to be able to use CapsLock as an additional modifier key.



I've explored xmodmap, xbindkeys, xte and it has been hit or miss, sometimes it works and sometimes it doesn't. At this point I'm happy to even write my own custom keyboard driver if that will allow me to do this, but I'm just frustrated at the lack of ability to do such a simple thing in Linux.



In Windows, I can do the same simply with Autohotkey and the following lines in a script:



; Turn off caps lock so it doesn't get pressed accidentally.
SetCapsLockState, AlwaysOff
CapsLock & k::Up
CapsLock & j::Down
CapsLock & h::Left
CapsLock & l::Right









share|improve this question















I want to do 2 things:



  1. Disable CapsLock key so that pressing it doesn't toggle CapsLock.

  2. Be able to set up custom combinations with CapsLock like:


    • CapsLock + j to map to Down key


    • CapsLock + k to map to Up key


I don't want to swap CapsLock with Ctrl or Win or any other modifier key. I want to be able to use CapsLock as an additional modifier key.



I've explored xmodmap, xbindkeys, xte and it has been hit or miss, sometimes it works and sometimes it doesn't. At this point I'm happy to even write my own custom keyboard driver if that will allow me to do this, but I'm just frustrated at the lack of ability to do such a simple thing in Linux.



In Windows, I can do the same simply with Autohotkey and the following lines in a script:



; Turn off caps lock so it doesn't get pressed accidentally.
SetCapsLockState, AlwaysOff
CapsLock & k::Up
CapsLock & j::Down
CapsLock & h::Left
CapsLock & l::Right






linux keyboard-shortcuts xmodmap






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Dec 4 at 6:38









Rui F Ribeiro

38.5k1479128




38.5k1479128










asked Dec 4 at 3:31









Plasty Grove

1041




1041







  • 2




    Possible duplicate of How to prevent the caps-lock toggle effect, without remapping or disabling it?
    – Ipor Sircer
    Dec 4 at 3:36






  • 1




    Thanks for the link. But it seems to answer only the first part of disabling capslock, doesn't explain how to set up custom keyboard combos with capslock.
    – Plasty Grove
    Dec 4 at 3:44










  • You've already know it: xbindkeys.
    – Ipor Sircer
    Dec 4 at 4:03










  • @IporSircer if it's that easy why don't you just give a simple working example? If I'm not mistaken, xbindkeys works by grabbing keys, which are causing spurious FocusOut/FocusIn+NotifyGrab events which are confusing the hell out of many apps.
    – mosvy
    Dec 4 at 4:18










  • Because he used windows-related code on a unix-only site.
    – Ipor Sircer
    Dec 4 at 4:21













  • 2




    Possible duplicate of How to prevent the caps-lock toggle effect, without remapping or disabling it?
    – Ipor Sircer
    Dec 4 at 3:36






  • 1




    Thanks for the link. But it seems to answer only the first part of disabling capslock, doesn't explain how to set up custom keyboard combos with capslock.
    – Plasty Grove
    Dec 4 at 3:44










  • You've already know it: xbindkeys.
    – Ipor Sircer
    Dec 4 at 4:03










  • @IporSircer if it's that easy why don't you just give a simple working example? If I'm not mistaken, xbindkeys works by grabbing keys, which are causing spurious FocusOut/FocusIn+NotifyGrab events which are confusing the hell out of many apps.
    – mosvy
    Dec 4 at 4:18










  • Because he used windows-related code on a unix-only site.
    – Ipor Sircer
    Dec 4 at 4:21








2




2




Possible duplicate of How to prevent the caps-lock toggle effect, without remapping or disabling it?
– Ipor Sircer
Dec 4 at 3:36




Possible duplicate of How to prevent the caps-lock toggle effect, without remapping or disabling it?
– Ipor Sircer
Dec 4 at 3:36




1




1




Thanks for the link. But it seems to answer only the first part of disabling capslock, doesn't explain how to set up custom keyboard combos with capslock.
– Plasty Grove
Dec 4 at 3:44




Thanks for the link. But it seems to answer only the first part of disabling capslock, doesn't explain how to set up custom keyboard combos with capslock.
– Plasty Grove
Dec 4 at 3:44












You've already know it: xbindkeys.
– Ipor Sircer
Dec 4 at 4:03




You've already know it: xbindkeys.
– Ipor Sircer
Dec 4 at 4:03












@IporSircer if it's that easy why don't you just give a simple working example? If I'm not mistaken, xbindkeys works by grabbing keys, which are causing spurious FocusOut/FocusIn+NotifyGrab events which are confusing the hell out of many apps.
– mosvy
Dec 4 at 4:18




@IporSircer if it's that easy why don't you just give a simple working example? If I'm not mistaken, xbindkeys works by grabbing keys, which are causing spurious FocusOut/FocusIn+NotifyGrab events which are confusing the hell out of many apps.
– mosvy
Dec 4 at 4:18












Because he used windows-related code on a unix-only site.
– Ipor Sircer
Dec 4 at 4:21





Because he used windows-related code on a unix-only site.
– Ipor Sircer
Dec 4 at 4:21
















active

oldest

votes











Your Answer








StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
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',
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
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%2funix.stackexchange.com%2fquestions%2f485814%2fusing-capslock-as-a-function-key%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown






























active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes















draft saved

draft discarded
















































Thanks for contributing an answer to Unix & Linux Stack Exchange!


  • 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.





Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


Please pay close attention to the following guidance:


  • 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%2funix.stackexchange.com%2fquestions%2f485814%2fusing-capslock-as-a-function-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

How to check contact read email or not when send email to Individual?

Bahrain

Postfix configuration issue with fips on centos 7; mailgun relay