Results 1 to 2 of 2

Thread: How to customize system-wide keyboard layout?

  1. #1
    Join Date
    May 2010
    Beans
    26

    How to customize system-wide keyboard layout?

    My HP laptop has a really annoying design feature by which the Insert key and the Print Screen key are on the same key. To use Insert, I have to hold down the function key. I hardly ever have reason to use the Print Screen key, but I have dozens of applications for which I use the Insert key more often that I use Enter or Delete. How can I modify my system-wide keyboard layout so this behavior is reversed; so the key is Insert by default and Print Screen when holding down the Fn key?

  2. #2
    Join Date
    Nov 2010
    Beans
    160
    Distro
    Kubuntu 11.04 Natty Narwhal

    Re: How to customize system-wide keyboard layout?

    Hi
    I think the software you are looking for is xmodmap. The function key acts weirdly, though, most of time, so it might be a little bit tricky to configure.
    Another useful software will be xev.

    I'll give you general steps, but if you need more precision, I will need some outputs.
    0) backup your keyboard mapping, just in case.
    Code:
    xmodmap -pke > .xmodmap.old
    xmodmap -pm >> .xmodmap.old
    1) find out keycodes sent by your key, and fn + your key with xev. They might or might not be the same.

    2a) If they are not the same. Let's say they are respectively 118 and 107.
    create (or edit if existing, for some reason) a ~/.xmodmap file. Add these lines to the end of it.
    Code:
    keycode 118 = Insert
    keycode 107 = Print
    2b) if the keycodes happen to be the same, say 118.
    Then, run
    Code:
    xmodmap -pke | grep 118 >> .xmodmap
    This will give your the line corresponding to your key in a .xmodmap file.
    You should see 'Print' and 'Insert' in it, just switch their positions.

    3) finally, run
    Code:
    xmodmap .xmodmap
    And see if it worked. If it didn't, just restore your configuration.
    Code:
    xmodmap .xmodmap.old
    Unless you want to rely on your desktop environnement to use it as a config file (so that it is loaded on login), you might want to add this line in your ~/.profile file (and create it if it doesn't exist):
    Code:
    xmodmap .xmodmap
    Hope it helps.
    Last edited by enimeizoo; August 6th, 2011 at 02:37 PM. Reason: typo

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
  •