You could also look through man xmodmap and xmodmap -help for additional options.įor example, xmodmap -pke lists your keymap table as expressions. You will need to insert the "keycode" you found for your F10 key. So I should be able to assign scroll lock to F10 with the following command: xmodmap -e "keycode 76 = Scroll_Lock" Yours maybe different since you are using a different layout. Take a look at the output of xmodmap -pke | grep F10. You should be able to apply it to any set of keys using xmodmap from the terminal.Įdit: You can also read more about Xmodmap here I got started on this answer from what I found here. That should change it to "New Accelorator" Just press F9.Īfter a little looking, I found an answer for scroll lock. After you've created it, click on the line to the right of the name where it says "Disabled". In the window that pops up, Name = Print Screen Command = gnome-screenshot. Here you can assign a command to any key or set of keys. Go to System Settings > keyboard > Custom Shortcuts. Xmodmap and saving it in your Home directory would allow you to run the changes simply by logging on after rebooting. Do the same for xmodmap -pke|egrep -e '(F10|Pause)'Īnd we are only interested in the keycodes 76 and 127.Ĭreate a new text document with your favourite text editor copy and paste the relevant information keycode 75 = Print NoSymbol Print 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. ![]() Scroll Lock = keycode 127, action Pause.Repeating the process for all four keys gave me 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.
0 Comments
Leave a Reply. |