Bind CAPS+hjkl to arrow keys; CAPS to ESC
Clash Royale CLAN TAG#URR8PPP
up vote
2
down vote
favorite
Currently running Antergos Linux. The set-up I would like to have is the following.
Pressing and releasing CAPS sends ESC.
The combinations of CAPS and any of CAPS+h, CAPS+j, CAPS+k, CAPS+l send Left, Down, Up, and Right respectively. Upon release of CAPS, ESC is not sent.
Of course, the goal here is to get some VIM-style bindings in programs which do not have them.
It seems that xcape would be useful here:
https://github.com/alols/xcape
But the examples do not get me quite as far as I would like.
Any help is appreciated.
EDIT: I came across a very useful answer here:
https://unix.stackexchange.com/a/163675/267068
Can anybody help me figure how to modify the procedure so that I get CAPS+hjkl as needed. Could I use Hyper_L, instead of the Super_L in that answer, and then map Hyper_L + hjkl to left, down, up, right?
keyboard-shortcuts
add a comment |Â
up vote
2
down vote
favorite
Currently running Antergos Linux. The set-up I would like to have is the following.
Pressing and releasing CAPS sends ESC.
The combinations of CAPS and any of CAPS+h, CAPS+j, CAPS+k, CAPS+l send Left, Down, Up, and Right respectively. Upon release of CAPS, ESC is not sent.
Of course, the goal here is to get some VIM-style bindings in programs which do not have them.
It seems that xcape would be useful here:
https://github.com/alols/xcape
But the examples do not get me quite as far as I would like.
Any help is appreciated.
EDIT: I came across a very useful answer here:
https://unix.stackexchange.com/a/163675/267068
Can anybody help me figure how to modify the procedure so that I get CAPS+hjkl as needed. Could I use Hyper_L, instead of the Super_L in that answer, and then map Hyper_L + hjkl to left, down, up, right?
keyboard-shortcuts
add a comment |Â
up vote
2
down vote
favorite
up vote
2
down vote
favorite
Currently running Antergos Linux. The set-up I would like to have is the following.
Pressing and releasing CAPS sends ESC.
The combinations of CAPS and any of CAPS+h, CAPS+j, CAPS+k, CAPS+l send Left, Down, Up, and Right respectively. Upon release of CAPS, ESC is not sent.
Of course, the goal here is to get some VIM-style bindings in programs which do not have them.
It seems that xcape would be useful here:
https://github.com/alols/xcape
But the examples do not get me quite as far as I would like.
Any help is appreciated.
EDIT: I came across a very useful answer here:
https://unix.stackexchange.com/a/163675/267068
Can anybody help me figure how to modify the procedure so that I get CAPS+hjkl as needed. Could I use Hyper_L, instead of the Super_L in that answer, and then map Hyper_L + hjkl to left, down, up, right?
keyboard-shortcuts
Currently running Antergos Linux. The set-up I would like to have is the following.
Pressing and releasing CAPS sends ESC.
The combinations of CAPS and any of CAPS+h, CAPS+j, CAPS+k, CAPS+l send Left, Down, Up, and Right respectively. Upon release of CAPS, ESC is not sent.
Of course, the goal here is to get some VIM-style bindings in programs which do not have them.
It seems that xcape would be useful here:
https://github.com/alols/xcape
But the examples do not get me quite as far as I would like.
Any help is appreciated.
EDIT: I came across a very useful answer here:
https://unix.stackexchange.com/a/163675/267068
Can anybody help me figure how to modify the procedure so that I get CAPS+hjkl as needed. Could I use Hyper_L, instead of the Super_L in that answer, and then map Hyper_L + hjkl to left, down, up, right?
keyboard-shortcuts
edited Feb 3 at 1:57
asked Jan 5 at 6:42
Nonnus
254
254
add a comment |Â
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
1
down vote
accepted
I wanted to do the exact same thing, and after some search and experiment, finally got it working.
Solution 1
(See solution 2 below, which is potentially better)
Step 1 (mapping caps_lock + hjkl): Follow this answer and add the config. You should add to the "us" file if you are using the US keyboard layout and skip the other keybindings that you're not interested in. Then run setxkbmap -layout us
.
Step 2 (caps_lock as escape): Run xcape -e 'ISO_Level3_Shift=Escape'
. You can add this line to your /etc/profile
so you don't have to run it manually after reboot.
===================================================
Solution 2 (probably better)
I was happy with solution 1, until I realized I couldn't use the key bindings in IntelliJ, which is a big bummer. Eventually I figured out that I could just use xmodmap and xcape to do the job, while still being able to use them in IntelliJ!
Step 1 (mapping caps_lock + hjkl): Create a file (say "~/.xmodmap") with the following content:
keycode 66 = Mode_switch
keysym h = h H Left
keysym l = l L Right
keysym k = k K Up
keysym j = j J Down
keysym u = u U Prior
keysym i = i I Home
keysym o = o O End
keysym p = p P Next
Feel free to skip the last 4 lines. I pasted them because they might be useful to you as well. In fact I'm really hoping to get the caps_lock enhancement working in Linux.
Then, run xmodmap ~/.xmodmap
.
Step 2 (caps_lock as escape): Run xcape -e 'Mode_switch=Escape'
.
Step 3 (optional): To avoid manually applying the keybindings, put the above 2 commands into your /etc/profile
.
Many thanks! Sorry for not responding sooner. I was off-grid for some time. However, with Solution 2, I get the following error when I run xcape: "No keycode found for keysym Escape in mapping Mode_switch."
â Nonnus
Apr 20 at 15:43
My mistake. Forgot to remove some old settings. This is working great. Thank you.
â Nonnus
Apr 20 at 15:52
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
accepted
I wanted to do the exact same thing, and after some search and experiment, finally got it working.
Solution 1
(See solution 2 below, which is potentially better)
Step 1 (mapping caps_lock + hjkl): Follow this answer and add the config. You should add to the "us" file if you are using the US keyboard layout and skip the other keybindings that you're not interested in. Then run setxkbmap -layout us
.
Step 2 (caps_lock as escape): Run xcape -e 'ISO_Level3_Shift=Escape'
. You can add this line to your /etc/profile
so you don't have to run it manually after reboot.
===================================================
Solution 2 (probably better)
I was happy with solution 1, until I realized I couldn't use the key bindings in IntelliJ, which is a big bummer. Eventually I figured out that I could just use xmodmap and xcape to do the job, while still being able to use them in IntelliJ!
Step 1 (mapping caps_lock + hjkl): Create a file (say "~/.xmodmap") with the following content:
keycode 66 = Mode_switch
keysym h = h H Left
keysym l = l L Right
keysym k = k K Up
keysym j = j J Down
keysym u = u U Prior
keysym i = i I Home
keysym o = o O End
keysym p = p P Next
Feel free to skip the last 4 lines. I pasted them because they might be useful to you as well. In fact I'm really hoping to get the caps_lock enhancement working in Linux.
Then, run xmodmap ~/.xmodmap
.
Step 2 (caps_lock as escape): Run xcape -e 'Mode_switch=Escape'
.
Step 3 (optional): To avoid manually applying the keybindings, put the above 2 commands into your /etc/profile
.
Many thanks! Sorry for not responding sooner. I was off-grid for some time. However, with Solution 2, I get the following error when I run xcape: "No keycode found for keysym Escape in mapping Mode_switch."
â Nonnus
Apr 20 at 15:43
My mistake. Forgot to remove some old settings. This is working great. Thank you.
â Nonnus
Apr 20 at 15:52
add a comment |Â
up vote
1
down vote
accepted
I wanted to do the exact same thing, and after some search and experiment, finally got it working.
Solution 1
(See solution 2 below, which is potentially better)
Step 1 (mapping caps_lock + hjkl): Follow this answer and add the config. You should add to the "us" file if you are using the US keyboard layout and skip the other keybindings that you're not interested in. Then run setxkbmap -layout us
.
Step 2 (caps_lock as escape): Run xcape -e 'ISO_Level3_Shift=Escape'
. You can add this line to your /etc/profile
so you don't have to run it manually after reboot.
===================================================
Solution 2 (probably better)
I was happy with solution 1, until I realized I couldn't use the key bindings in IntelliJ, which is a big bummer. Eventually I figured out that I could just use xmodmap and xcape to do the job, while still being able to use them in IntelliJ!
Step 1 (mapping caps_lock + hjkl): Create a file (say "~/.xmodmap") with the following content:
keycode 66 = Mode_switch
keysym h = h H Left
keysym l = l L Right
keysym k = k K Up
keysym j = j J Down
keysym u = u U Prior
keysym i = i I Home
keysym o = o O End
keysym p = p P Next
Feel free to skip the last 4 lines. I pasted them because they might be useful to you as well. In fact I'm really hoping to get the caps_lock enhancement working in Linux.
Then, run xmodmap ~/.xmodmap
.
Step 2 (caps_lock as escape): Run xcape -e 'Mode_switch=Escape'
.
Step 3 (optional): To avoid manually applying the keybindings, put the above 2 commands into your /etc/profile
.
Many thanks! Sorry for not responding sooner. I was off-grid for some time. However, with Solution 2, I get the following error when I run xcape: "No keycode found for keysym Escape in mapping Mode_switch."
â Nonnus
Apr 20 at 15:43
My mistake. Forgot to remove some old settings. This is working great. Thank you.
â Nonnus
Apr 20 at 15:52
add a comment |Â
up vote
1
down vote
accepted
up vote
1
down vote
accepted
I wanted to do the exact same thing, and after some search and experiment, finally got it working.
Solution 1
(See solution 2 below, which is potentially better)
Step 1 (mapping caps_lock + hjkl): Follow this answer and add the config. You should add to the "us" file if you are using the US keyboard layout and skip the other keybindings that you're not interested in. Then run setxkbmap -layout us
.
Step 2 (caps_lock as escape): Run xcape -e 'ISO_Level3_Shift=Escape'
. You can add this line to your /etc/profile
so you don't have to run it manually after reboot.
===================================================
Solution 2 (probably better)
I was happy with solution 1, until I realized I couldn't use the key bindings in IntelliJ, which is a big bummer. Eventually I figured out that I could just use xmodmap and xcape to do the job, while still being able to use them in IntelliJ!
Step 1 (mapping caps_lock + hjkl): Create a file (say "~/.xmodmap") with the following content:
keycode 66 = Mode_switch
keysym h = h H Left
keysym l = l L Right
keysym k = k K Up
keysym j = j J Down
keysym u = u U Prior
keysym i = i I Home
keysym o = o O End
keysym p = p P Next
Feel free to skip the last 4 lines. I pasted them because they might be useful to you as well. In fact I'm really hoping to get the caps_lock enhancement working in Linux.
Then, run xmodmap ~/.xmodmap
.
Step 2 (caps_lock as escape): Run xcape -e 'Mode_switch=Escape'
.
Step 3 (optional): To avoid manually applying the keybindings, put the above 2 commands into your /etc/profile
.
I wanted to do the exact same thing, and after some search and experiment, finally got it working.
Solution 1
(See solution 2 below, which is potentially better)
Step 1 (mapping caps_lock + hjkl): Follow this answer and add the config. You should add to the "us" file if you are using the US keyboard layout and skip the other keybindings that you're not interested in. Then run setxkbmap -layout us
.
Step 2 (caps_lock as escape): Run xcape -e 'ISO_Level3_Shift=Escape'
. You can add this line to your /etc/profile
so you don't have to run it manually after reboot.
===================================================
Solution 2 (probably better)
I was happy with solution 1, until I realized I couldn't use the key bindings in IntelliJ, which is a big bummer. Eventually I figured out that I could just use xmodmap and xcape to do the job, while still being able to use them in IntelliJ!
Step 1 (mapping caps_lock + hjkl): Create a file (say "~/.xmodmap") with the following content:
keycode 66 = Mode_switch
keysym h = h H Left
keysym l = l L Right
keysym k = k K Up
keysym j = j J Down
keysym u = u U Prior
keysym i = i I Home
keysym o = o O End
keysym p = p P Next
Feel free to skip the last 4 lines. I pasted them because they might be useful to you as well. In fact I'm really hoping to get the caps_lock enhancement working in Linux.
Then, run xmodmap ~/.xmodmap
.
Step 2 (caps_lock as escape): Run xcape -e 'Mode_switch=Escape'
.
Step 3 (optional): To avoid manually applying the keybindings, put the above 2 commands into your /etc/profile
.
edited Mar 28 at 23:30
answered Mar 28 at 18:38
matrinica
262
262
Many thanks! Sorry for not responding sooner. I was off-grid for some time. However, with Solution 2, I get the following error when I run xcape: "No keycode found for keysym Escape in mapping Mode_switch."
â Nonnus
Apr 20 at 15:43
My mistake. Forgot to remove some old settings. This is working great. Thank you.
â Nonnus
Apr 20 at 15:52
add a comment |Â
Many thanks! Sorry for not responding sooner. I was off-grid for some time. However, with Solution 2, I get the following error when I run xcape: "No keycode found for keysym Escape in mapping Mode_switch."
â Nonnus
Apr 20 at 15:43
My mistake. Forgot to remove some old settings. This is working great. Thank you.
â Nonnus
Apr 20 at 15:52
Many thanks! Sorry for not responding sooner. I was off-grid for some time. However, with Solution 2, I get the following error when I run xcape: "No keycode found for keysym Escape in mapping Mode_switch."
â Nonnus
Apr 20 at 15:43
Many thanks! Sorry for not responding sooner. I was off-grid for some time. However, with Solution 2, I get the following error when I run xcape: "No keycode found for keysym Escape in mapping Mode_switch."
â Nonnus
Apr 20 at 15:43
My mistake. Forgot to remove some old settings. This is working great. Thank you.
â Nonnus
Apr 20 at 15:52
My mistake. Forgot to remove some old settings. This is working great. Thank you.
â Nonnus
Apr 20 at 15:52
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f414926%2fbind-capshjkl-to-arrow-keys-caps-to-esc%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password