Pat Gunn (dachte) wrote,
Pat Gunn
dachte

Pogromabble Keyborg

Fellow Unix people,

If you think being able to type things that are not present on your keyboard is awesome, you have three options, and should do all three:

  1. Use SCIM. It's heavyweight, and requires a keycode and uses a helper window to choose between entirely different keymaps you use for particular languages. It's really nice for extended typing in those languages, and requires the least brainpower to setup.
  2. Map yourself a compose key - compose keys are great for letting you quickly type things you seldom use - there's a set of mostly intuitive combinations of two keys that you type after hitting whatever you've mapped to compose, and it fills in the corrispomnding key. This is great for doing accents and umlauts, but also nice for things like degrees signs (compose-caret-0 = ⁰)
  3. Map specific direct keys using AltGr - This is another modifier key you can map and flexibly assign symbols/etc to your existing keys for. This is probably more similar to the way Macs traditionally have given people alternative characters. I just learned how to do this.
To set up scim ... depends on your distro. Sorry.To do the latter two, you'll be editing your .xmodmaprc (and possibly figuring out how to tell your window mangler/desktop environment to run xmodmap on it whenever you log in)

Personally, I don't like caps lock, but because I didn't grow up on keyboards with the control key in that location, I prefer to remap my caps lock to compose. I also don't use my right control key, and prefer to map that to AltGr. If you're the same, drop these in your .xmodmaprc:

  • keycode 105=Mode_switch
  • remove Lock = Caps_Lock
  • keycode 66 = Multi_key

To add new alternative graphs (altgr values), you'll want a line for each key with 4 values:

  • What the key should be normally
  • What the key should be while shift is held
  • What the key should be while AltGr is held
  • What the key should be while shift and AltGr are held
The "should be" is either a unix keysym value (use xev to get this) or a unicode value.Personally, I love the Japanese quoting characters, and I know they're 300C and 300D (and have "doublequotes" at 300E and 300F), so I'll use them as examples - add this to your .xmodmaprc:
  • keysym bracketleft = bracketleft braceleft U0300C U0300E
  • keysym bracketright = bracketright braceright U0300D U0300F
After loading that (you can test these things with xmodmap -e "command"), holding altgr while pressing my left bracket gives me a 「 (your terminal must be able to handle unicode for this to be worthwhile, although this works with all X software)

The man page for xmodmap is sadly deficient..

Tags: tech
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 2 comments