Is there anyway to create shortcuts for functions like Home, End, Pg Up, Pg Down, etc? I frequently use the aforementioned keys, however those keys are only available when the numpad is disabled - there is no dedicated keys for those function on my laptop. I was thinking of using the Fn key to trigger them even when the numpad is enabled.
Asked
Active
Viewed 3,528 times
1 Answers
5
Approach 1. Using Fn key
Check the keycode of yours key. Run this program at terminal.
xev
At this example, the terminal shows that the keycode for my k is "45".
Change them as you like creating this file:
gedit ~/.XmodmapIt's contents should look like this example:
keycode 180 = Home End Down(
keycode 180is for Fn+F3 at my notebook)Ilustration:

(Obs.: if I want to change my k I must use
keycode 45as showed at step "1", if I want to change my Fn+F3 I must usekeycode 180).Log out and log back in or reboot or run this:
xmodmap ~/.Xmodmap
Approach 2. Using a shortcut (combination keys)
-
sudo aptitude install xdotool Open Gnome Keybindings
gnome-keybinding-propertiesCreate the shortcut with this commands:
xdotool getactivewindow key Home xdotool getactivewindow key End xdotool getactivewindow key Page_Up xdotool getactivewindow key Page_DownExample:
Enjoy!
David Foerster
- 35,754
- 55
- 92
- 145
desgua
- 32,669
- 9
- 99
- 120
-
Running `xev` opens a white window with a square outline. What next? – Oxwivi Apr 09 '11 at 14:53
-
Ah, I didn't think Terminal output was important... Can you please give me a random example making Fn + random key reproducing effects of pressing Home button? – Oxwivi Apr 09 '11 at 15:55
-
I don't understand what I should write in the new file. What does each word after `keycode 51 =` represent? – Oxwivi Apr 10 '11 at 19:02
-
OH! So `keycode 51` is called by the keys that's mentioned? – Oxwivi Apr 11 '11 at 11:24
-
I'll be honest, I don't get what I have to do. For example, my Home button's `keycode 79`, and I want to use Home with Fn + Numpad 7 key. Due to circumstances, I am not able to use Ubuntu as much as I'd like to, so sorry for the drawn out discussion. – Oxwivi Apr 12 '11 at 05:53
-
But I still don't understand what the example in the screen shot does. – Oxwivi Apr 12 '11 at 10:43
-
This example make my physical keyboard key that has this "]" simbol when I look down at my keyboard (witch is represented by keycode 51 when I look to my monitor, at terminal output of xev) to function like if I had pushed Sysreq key if I pushed it alone. If I push it with Shift, then it will insert this character "]". If I push it with Alt, then it will insert this character "}". If I push it with right Alt, it will insert this character "a". And finally, if I push it with Shift and right Alt together, it will insert this character "A". – desgua Apr 12 '11 at 12:06
-
I understand now. But each of the keys you specified were automatically assigned to shift, alt, etc in the order they were written. But what about the Fn key, and how do I only assign a function with Fn? – Oxwivi Apr 15 '11 at 22:29
-
Like I said before: not all keys can be combined with "Fn". The keys that can are those witch different keycode numbers when pressed alone or combined with "Fn". Check this with xev. – desgua Apr 16 '11 at 00:36
-
`xwv` does not recognise Fn being pressed individually, and pressing with numpad 7 (where I want to apply Home function) does not give a new keycode. So combining with Fn out of question? What about the super key? – Oxwivi Apr 16 '11 at 09:49
-
I think that with Super key it's possible, but it's a totally different question. I will see if I can do that when I get home in a few hours ;-) – desgua Apr 16 '11 at 10:28
-
@desgua, you don't how much of a help you are! Thanks! – Oxwivi Apr 16 '11 at 10:30
-
It's done. Look at the answer ;-) – desgua Apr 16 '11 at 20:47
-
Oh man, I gotta install something... So how does this work. Say I want to use End by Fn+L? Does this support Fn? – Oxwivi Apr 17 '11 at 06:25
-
Nope. As I said before, this is another approach for a different question. It is simple to install. Just click at 'Install xdotool' and you're done. – desgua Apr 17 '11 at 12:21
-
I know installing is simple, but I want to use as less packages as possible. What does it support? I can't understand from the example what key you're assigning what function. – Oxwivi Apr 18 '11 at 05:37
-
The function is Home and the combination shortcut isn't showed in this picture. I think you should try to follow the explanation instead of just read because many things are intuitive. – desgua Apr 18 '11 at 10:13
-
Where can I get the list of keys it supports? It isn't there in man. – Oxwivi Apr 18 '11 at 18:06
-
You can just open the Gnome keybindings and try the keys you want. – desgua Apr 18 '11 at 18:53
-
For the .Xmodmap solution, the functions, how do I skip to assigning something with Alt without starting with Shift and all? – Oxwivi Apr 23 '11 at 15:28
-
I didn't understand what you are asking now. – desgua Apr 23 '11 at 17:03
-
In the example screen shot, each of the buttons defined for nothing, right shift, left shift, etc. I am assuming that in the order of the functions written, it's assigned to nothing, Shift, Alt, rAlt, etc. So how can I move to Alt without assigning anything for shift? – Oxwivi Apr 23 '11 at 17:08
-
I still don't get it. What screenshot (let's call then 1 -> http://dl.dropbox.com/u/4098082/xev.png --- 2 -> http://dl.dropbox.com/u/4098082/Xmodmap.1.png --- 3 -> http://i.imgur.com/gwnV5.jpg ? I can't find this assigns you pointed "nothing, Shift, Alt, rAlt, etc." – desgua Apr 23 '11 at 19:02
-
For the image 2, you had said: 'This example make my physical keyboard key that has this "]" simbol when I look down at my keyboard (witch is represented by keycode 51 when I look to my monitor, at terminal output of xev) to function like if I had pushed Sysreq key if I pushed it alone. If I push it with Shift, then it will insert this character "]". If I push it with Alt, then it will insert this character "}". If I push it with right Alt, it will insert this character "a". And finally, if I push it with Shift and right Alt together, it will insert this character "A".' – Oxwivi Apr 24 '11 at 07:18
-
Now I got it. You just need to put "NoSymbol" (without cotes) to move to the next assignment. – desgua Apr 24 '11 at 11:41
-
What all keys are available to combine? Is there some sort of `man` page I can refer to? – Oxwivi Apr 25 '11 at 06:03
-
You can test the keys you want opening `gnome-keybinding-properties` > go to a shortcut named `Disabled` > click on it > test your key combination. Also you can read `man xev` and `man xmodmap` – desgua Apr 25 '11 at 23:04
