We are only interested in the keycodes 75 and 107. To do this run xmodmap -pke|egrep -e '(F9|Print)' Xmodmap -e "keycode 107 mod1 = F9 Sys_Req"ĭoes indeed do what is intended all that is left to do is get this happening at startup time. Swapping the Scroll Lock and F10 buttons is easier xmodmap -e "keycode 127 = F10"Īfter making sure that when running xmodmap -e "keycode 75 = Print" Should swap F9 to where PrtSc was keeping the modified SysReq ( Alt + PrtSc) again we can use xev to help verify this. Adding xmodmap -e "keycode 107 mod1 = F9 Sys_Req" That is until you log out or shutdown etc so what we have to do after confirming the commands xmodmap -e "keycode 75 = Print"ĭo give the desired results is sort out SysRec which is modified PrtSc and swap over the other buttons so we do not have multiple instances of same key action. Which confirms the "action" for the Scroll Lock key is "Pause" so for making the F10 act as Scroll Lock trying xmodmap -e "keycode 76 = Pause" the keycode stays the same but pressing the F9 key will have different results. To make the F9 key behave as if the PrtSc key has been pressed. Now that we have the key codes for identifying the keys we now make the system do what we want by using xmodmap and as we know F9 has "keycode 75" and PrtSc has the action of "Print" all we need to do is xmodmap -e "keycode 75 = Print" To change a keys function we need to know the keycode of the NEW key being pressed and the "action" of the OLD or existing key for that function.
So all credit to NES, llazarte, bodhi.zazen and Argusvision.įrom Terminal run xev and then press F9 which would give something likeĭoing the same for PrtSc did not give any output in xev for me (or I could not find the "KeyPress event") so I used Argusvision's advice for using the Custom Shortcuts in All Settings but doing so in order to disable PrtSc as screenshot button by reassigning as Shift + Alt then tried pressing again which gave me keycode 107 for PrtSc in xev like so This other Ask Ubuntu answer was very helpful to. This answer has been mostly made up using the information from the first three steps of this Ask Ubuntu answer and this Ubuntu Forums thread to which it links/refers to.