Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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.

share|improve this question

1 Answer 1

up vote 2 down vote accepted

Approach One - Using Fn key

1) 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".

2) Change them as you like creating this file:

gedit ~/.Xmodmap

It's contents should look like this example:

keycode 180 = Home End Down

("keycode 180" is for Fn + F3 at my notebook)

Ilustration:
(Obs.: if I want to change my k I must use "keycode 45" as showed at step "1", if I want to change my Fn + F3 I must use "keycode 180").

4) Logout and log back in or reboot or run this:

xmodmap ~/.Xmodmap

Approach Two - Using a shortcut (combination keys)

1) Install xdotool

sudo aptitude install xdotool  

2) Open Gnome Keybindings

gnome-keybinding-properties  

3) Create the shortcut with this commands:

xdotool getactivewindow key Home

xdotool getactivewindow key End

xdotool getactivewindow key Page_Up

xdotool getactivewindow key Page_Down

Example:
enter image description here

Enjoy ;-)

share|improve this answer
    
Running xev opens a white window with a square outline. What next? –  Oxwivi Apr 9 '11 at 14:53
    
Ah, I didn't think Terminal output was important... Can you please give me a random example making <kbd>Fn</kbd> + <kbd>random key</kbd> reproducing effects of pressing Home button? –  Oxwivi Apr 9 '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 5:53

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.