Some keys in my keyboard came to a sticky end after a catastrophic coke spill. I do not intend to replace the old keyboard, since the whole laptop will be replaced next year.

The keys in question are: arrow up, arrow down, shift and '/'.

Shift has a twin brother on the west coast, who's doing all the work now, and I could rewire '/' as 'delete' (now I realize this was a totally useless key) with the xmodmap -e 'keycode 119=/' command. That is, pressing 'delete' outputs a '/' now.

To discover how to replace the keys I use xev. I intend to replace arrow-up and arrow-down for pgup and pgdn respectively. Unhappily arrow-up/down do not have output. I know that pgup and pgdn are keycodes 112 and keycodes 117. But what should I fill in in the xmodmap -e 'keycode <value>=<action>' pattern asxmodmap -e 'keycode 112=' and xmodmap -e 'keycode 117='

  • Assuming you are talking about the keyboard of the laptop itself, a quick and simple solution till the replacement of your laptop could be a cheap USB keyboard. – Crovaxon Dec 27 '18 at 8:42
  • While Stephen Kitt's will work, if there is any way you can, I suggest fixing, replacing, or circumventing (USB keyboard) the keyboard. The $50 saved is not worth the effort of retraining your self to type incorrectly, then to have to re-train yourself to type properly again. – coteyr Dec 27 '18 at 10:23

See /usr/include/X11/keysymdef.h for the available key names:

xmodmap -e 'keycode 112=Up'
xmodmap -e 'keycode 117=Down'

(the prefixes need to be removed).

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.