Map Down Arrow key to Shift Up Arrow key
An old laptop with missing cap on the down arrow key. So I would like to map the down arrow key to Shift-Up arrow. Tried with xmodmap...keycodes are 111 and 116. So I created an ~/.Xmodmap with keycode 111 (up arrow) to Up Down Up (which I thought meant press key, press Shift and key for the second one (instead of No-Symbol). Ran xmodmap and the change went in. But regardless of restarting X or rebooting, this had no effect on the up arrow key.
Can anyone tell me how to do this? Thanks.
About this post
- Posted
- Archived
- Score
- 8 · 75% up
- Kind
- Text
- ID
- pvm48d
5 comments
You're right about how xmodmap works, 1st is the default key and 2nd is key+shift.
I just tested it with
xmodmap -e "keycode 111 = Up Down"and it partially worked. It shift+up sends a down, but since shift is still held programs interpret this as shift+down. I don't think xmodmap alone can do what you want.Hard part is making it so that shif+up doesn't send shift... It might be worth investigating this program, though I'm not entirely sure it can do what you want (never used it)
I will take a look at Kmonad and see if it's for me. Thanks for the help.
This can be done using
Xmodmapand theMode_switchkey.I map my left Alt button to be the Mode_switch key, and have h, j, k, and l become Left, Down, Up, and Right when the Mode_switch key is held. I have the following in my
~/.Xmodmapfile:The first keysym
his used when no modifier key is pressed in conjunction with the key, the secondHwithShift, and the thirdLeftwhen theMode_switchkey is held.For an answer close to how you described, first choose a key to bind to the Mode_switch key. The keycode of a key can be found using the
xevprogram. Then bind the Up keys Mode_switch slot to send the Down key.Load the changes to the Xmodmap file using:
I think this is almost certainly what I was looking for. Thank you. I can't try it out just now (subject computer not available), but I will.
I am still curious as to why
keysym Up = Up Down
wouldn't work for Shift Up as a Down key, but your solution makes it a moot point.
Thanks again.