Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: Assign PgUp and PgDn keys - eeePC

  1. #1
    Join Date
    Jun 2009
    Location
    Brasilia, Brazil
    Beans
    24
    Distro
    Ubuntu Karmic Koala (testing)

    Wink Assign PgUp and PgDn keys - eeePC

    Hello, I am quite happy with my 1008HA, except that for using PgUp and PgDn keys it is necessary to press Fn simultaneously.

    I use those two keys quite frequently, and am getting a pain in my arm because of this

    Any hint as to how could I change the behaviour of those keys?

    I would like to press PgUp and PgDn without the need of pressing Fn, to get Page Up and Down. Pressing Fn together with PgUp and PgDn could produce Up and Down.

    Thanks for any help!
    Leonardo
    Last edited by llazarte; July 25th, 2009 at 08:43 AM.

  2. #2
    Join Date
    Jun 2009
    Location
    Brasilia, Brazil
    Beans
    24
    Distro
    Ubuntu Karmic Koala (testing)

    Wink Remapping keyboard keys

    The solution is to remap some keys, that is, to choose some keys on your keyboard to peform certain actions.

    In my case, I wanted to avoid having to press Fn together with Up or Down to get PageUp or PageDown.

    Step 0: Choose a key, or a key combination, to perform the desired action. In my case, I wanted to reverse the behavior of pressing Up and Fn+Up and Down and Fn+Down. That means FOUR definitions: two key definitions (Up and Down) and two key combinations (Fn+Up and Fn+Down).

    Step 2
    : Discover how your system sees those keys, using the command "xev" and pressing the keys whose id you want to discover. In my case pressing Up, Down, Fn+Up and Fn+Down produced the result below, which means:

    1. Pressing Down produces the kyecode 116, which is assigned to the action Down.

    KeyPress event, serial 31, synthetic NO, window 0x3a00001,
    root 0xa5, subw 0x0, time 13735531, (165,-16), root(170,32),
    state 0x0, keycode 116 (keysym 0xff54, Down), same_screen YES,
    XLookupString gives 0 bytes:
    XmbLookupString gives 0 bytes:
    XFilterEvent returns: False

    2. Pressing Up produces keycode 111, assigned to action Up.

    KeyPress event, serial 34, synthetic NO, window 0x3a00001,
    root 0xa5, subw 0x0, time 13739005, (165,-16), root(170,32),
    state 0x0, keycode 111 (keysym 0xff52, Up), same_screen YES,
    XLookupString gives 0 bytes:
    XmbLookupString gives 0 bytes:
    XFilterEvent returns: False

    3. Pressing Fn+Down produces keycode 117, assigned to action Next (page down).

    KeyPress event, serial 34, synthetic NO, window 0x3a00001,
    root 0xa5, subw 0x0, time 13751243, (165,-16), root(170,32),
    state 0x0, keycode 117 (keysym 0xff56, Next), same_screen YES,
    XKeysymToKeycode returns keycode: 105
    XLookupString gives 0 bytes:
    XmbLookupString gives 0 bytes:
    XFilterEvent returns: False

    4. Pressing Fn+Up produces keycode 112, with action Prior (page up).

    KeyPress event, serial 34, synthetic NO, window 0x3a00001,
    root 0xa5, subw 0x0, time 13752671, (165,-16), root(170,32),
    state 0x0, keycode 112 (keysym 0xff55, Prior), same_screen YES,
    XLookupString gives 0 bytes:
    XmbLookupString gives 0 bytes:
    XFilterEvent returns: False

    Once you know the keycode of the keys you would like to use, and the name of the actions you want to perform, you can assign the desired actions to the chosen keys.


    Step 3: The following four commands will produce the desired change, valid only for the present X session:

    Code:
    # xmodmap -e "keycode 116 = Next"; xmodmap -e "keycode 111 = Down" 
    # xmodmap -e "keycode 117 = Prior"; xmodmap -e "keycode 112 = Up"


    Step 3b
    : To get these changes for every session, after issuing the commands above, create a file called .Xmodmap (or whatever), with the following command:

    Code:
    # xmodmap -pke > .Xmodmap
    Then, create a file called .xinitrc in your home directory, containing just the following line:
    Code:
    xmodmap .Xmodmap
    Good luck!


  3. #3
    Join Date
    Nov 2009
    Beans
    23

    Re: Remapping keyboard keys

    Quote Originally Posted by llazarte View Post
    The solution is to remap some keys, that is, to choose some keys on your keyboard to peform certain actions.

    In my case, I wanted to avoid having to press Fn together with Up or Down to get PageUp or PageDown.

    Step 0: Choose a key, or a key combination, to perform the desired action. In my case, I wanted to reverse the behavior of pressing Up and Fn+Up and Down and Fn+Down. That means FOUR definitions: two key definitions (Up and Down) and two key combinations (Fn+Up and Fn+Down).

    Step 2
    : Discover how your system sees those keys, using the command "xev" and pressing the keys whose id you want to discover.
    This is interesting. I had a brainstorm just now that I would like map Page Up/Down functions to CTRL+Arrow. On the EEEPC 1000 there is this tiny duplicate CTRL button right by the arrow keys that is basically useless.... unless it could be combined with arrow keys to do page up/down. Only one hand required!

    Problem is the CTRL+arrow does not have an action associated with it. After running xev, it seems the system sees it as 2 separate keypresses rather than a single function. How can this be changed?

    Basically I would like to associate CTRL+Arrow to do PageUp/Down, or map the tiny CTRL button to be a Fn key instead.

  4. #4
    Join Date
    Jun 2009
    Location
    Brasilia, Brazil
    Beans
    24
    Distro
    Ubuntu Karmic Koala (testing)

    Re: Remapping keyboard keys

    Quote Originally Posted by majest View Post
    This is interesting. I had a brainstorm just now that I would like map Page Up/Down functions to CTRL+Arrow. On the EEEPC 1000 there is this tiny duplicate CTRL button right by the arrow keys that is basically useless.... unless it could be combined with arrow keys to do page up/down. Only one hand required!

    Problem is the CTRL+arrow does not have an action associated with it. After running xev, it seems the system sees it as 2 separate keypresses rather than a single function. How can this be changed?

    Basically I would like to associate CTRL+Arrow to do PageUp/Down, or map the tiny CTRL button to be a Fn key instead.
    I suggest that you run "xev", and then take note of how is your "tiny CTRL button" identified while you press it.

    Next step is to discover where to associate the action PageUp with the arrow key. That is, on .xinitrc (or whatever), you should check if this "tiny CTRL" changes the action of a given key. Just check, for example, by redefining key "a" to produce letter "b", on 1st, 2nd, 3rd, 4th position.
    Leonardo
    Universidade de Brasilia

  5. #5
    Join Date
    Nov 2009
    Beans
    23

    Re: Remapping keyboard keys

    Quote Originally Posted by llazarte View Post
    I suggest that you run "xev", and then take note of how is your "tiny CTRL button" identified while you press it.

    Next step is to discover where to associate the action PageUp with the arrow key. That is, on .xinitrc (or whatever), you should check if this "tiny CTRL" changes the action of a given key. Just check, for example, by redefining key "a" to produce letter "b", on 1st, 2nd, 3rd, 4th position.
    Hi - thanks for your reply

    The tiny CTRL has the following action:
    KeyPress event, serial 36, synthetic NO, window 0x3800001,
    root 0xf9, subw 0x0, time 7211977, (607,255), root612,278),
    state 0x0, keycode 105 (keysym 0xffe4, Control_R), same_screen YES,
    XLookupString gives 0 bytes:
    XmbLookupString gives 0 bytes:
    XFilterEvent returns: False

    and the large CTRL button has:
    KeyPress event, serial 36, synthetic NO, window 0x3800001,
    root 0xf9, subw 0x0, time 7107284, (668,202), root673,225),
    state 0x0, keycode 37 (keysym 0xffe3, Control_L), same_screen YES,
    XLookupString gives 0 bytes:
    XmbLookupString gives 0 bytes:
    XFilterEvent returns: False


    Based on a little internet searching I learned of gconf-editor, and have made CTRLR+Up execute a command (gvim). This works, however I am unable to find a command associated with a PageUp keypress. The command would appear to be Next but putting this in gconf-editor, instead of gvim, results in nothing happening.

  6. #6
    Join Date
    Nov 2009
    Beans
    23

    Re: Remapping keyboard keys

    I found something called xte which should have solved the problem. In gconf-editor -> apps -> metacity -> global keybindings and -> keybinding commands, I assigned command1 to execute xte "key Page_Up" in response to CTRL+Up arrow. Well it does something when I press those keys but not what I want. In Firefox it seems to switch between tabs but very erratically. This is odd.

  7. #7
    Join Date
    Nov 2009
    Beans
    23

    Re: Remapping keyboard keys

    Quote Originally Posted by majest View Post
    I found something called xte which should have solved the problem. In gconf-editor -> apps -> metacity -> global keybindings and -> keybinding commands, I assigned command1 to execute xte "key Page_Up" in response to CTRL+Up arrow. Well it does something when I press those keys but not what I want. In Firefox it seems to switch between tabs but very erratically. This is odd.
    Just a little bump Any ideas?

  8. #8
    Join Date
    Jun 2008
    Location
    SF Bay Area, CA
    Beans
    80
    Distro
    Ubuntu Development Release

    Question Re: Assign PgUp and PgDn keys - eeePC

    Another quick bump, I'm trying to do this same thing.

  9. #9
    Join Date
    Jun 2009
    Location
    Brasilia, Brazil
    Beans
    24
    Distro
    Ubuntu Karmic Koala (testing)

    Re: Assign PgUp and PgDn keys - eeePC

    Hi! (grantbow) Did you try the steps in the message from July 25th, 2009 04:09 AM?

    By the way (majest), the name of action for PageUp seems to be "Prior".
    Leonardo
    Universidade de Brasilia

  10. #10
    Join Date
    Jun 2008
    Location
    SF Bay Area, CA
    Beans
    80
    Distro
    Ubuntu Development Release

    Re: Assign PgUp and PgDn keys - eeePC

    llazarte, thank you very much for your helpful replies. I am sorry for my delayed response but my computer was on loan for a few months, delaying my progress.

    I found the following:
    keycode 111 action is Up - great, no change, arrow up
    keycode 116 action is Down - great, no change, arrow down
    keycode 112 action is Prior - great, no change, Page Up
    keycode 117 action is Next - great, no change, Page Down
    keycode 37 action is Control_L - this is the Ctrl key

    xev is very helpful in identifying single key presses but chorded keys seem a little odd to me. I'm not sure where to go from here to make sure it's mapped via X instead of the gnome workarounds mentioned by majest.

    When I do Ctrl-"arrow up" I get the following where I clearly see the Ctrl key press and release but I don't see the keycode 111 used in those two rows of 0s in the middle where I think it should be:

    KeyPress event, serial 33, synthetic NO, window 0x6800001,
    root 0x103, subw 0x6800002, time 5859674, (30,48), root853,101),
    state 0x10, keycode 37 (keysym 0xffe3, Control_L), same_screen YES,
    XLookupString gives 0 bytes:
    XmbLookupString gives 0 bytes:
    XFilterEvent returns: False

    FocusOut event, serial 36, synthetic NO, window 0x6800001,
    mode NotifyGrab, detail NotifyAncestor

    MappingNotify event, serial 36, synthetic NO, window 0x0,
    request MappingKeyboard, first_keycode 8, count 248

    FocusIn event, serial 37, synthetic NO, window 0x6800001,
    mode NotifyUngrab, detail NotifyAncestor

    KeymapNotify event, serial 37, synthetic NO, window 0x0,
    keys: 3 0 0 0 32 0 0 0 0 0 0 0 0 0 0 0
    0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

    KeyRelease event, serial 37, synthetic NO, window 0x6800001,
    root 0x103, subw 0x6800002, time 5860486, (30,48), root853,101),
    state 0x14, keycode 37 (keysym 0xffe3, Control_L), same_screen YES,
    XLookupString gives 0 bytes:
    XFilterEvent returns: False

    MappingNotify event, serial 37, synthetic NO, window 0x0,
    request MappingKeyboard, first_keycode 8, count 248

Page 1 of 2 12 LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •