1

I'm unsure how to swap these 2, this is the thought process I had but am unsure how to get it working:

remove sh = Shift_R
remove dl = Delete

keysym Delete = Shift_R
keysym Shift_R = Delete

add sh = Delete
add dl = Shift_R

This is based on the code I use to swap caps lock and control.

Any thoughts?

xmodmap output:

dan@lantea:~$ xmodmap -pke | grep Shift_R
keycode  91 = Shift_R NoSymbol Shift_R
keycode 119 = Shift_R NoSymbol Shift_R
dan@lantea:~$ xmodmap -pke | grep Delete
keycode  62 = Delete NoSymbol Delete
1

You can use the following commands:

xmodmap -e "keycode 62 = Delete NoSymbol Delete"    #this will make Shift_R key to act as delete
xmodmap -e "keycode 119 = Shift_R NoSymbol Shift_R" #this will make Delete key to act as right shift

To get this change for every session, after you have run the ​​previous commands, create a file called .xmodmap with the new keymaps, using the following command:

xmodmap -pke > .xmodmap

Then, create a file called .xinitrc in your home directory, containing the following line/command:

xmodmap .xmodmap

And finally, make .xinitrc file to be executable:

chmod 755 ~/.xinitrc
  • I'm afraid the second xmodmap command, does not the delete key act as right shift. The first one works however. – Dan LaManna Dec 9 '13 at 20:13
  • @DanLaManna Don't be afraid, just try it. It should work. See the output of xmodmap -pke | grep Shift_R and xmodmap -pke | grep Delete commands. – Radu Rădeanu Dec 9 '13 at 20:16
  • I did, the shift keys acts as delete, but delete does not act as shift, I edited the question to include the output of those 2 grep commands. – Dan LaManna Dec 9 '13 at 20:19
  • 1
    @DanLaManna Then try to use xmodmap -e "keycode 119 = Shift_L NoSymbol Shift_L". Is exactly the same thing. Maybe you have a problem depending on which keyboard layout are you using. – Radu Rădeanu Dec 9 '13 at 20:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.