LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   xmodmap Ã¥, ä, ö, and ø - or how to add Compose to X (https://www.linuxquestions.org/questions/slackware-14/xmodmap-%C3%A5-%C3%A4-%C3%B6-and-%C3%B8-or-how-to-add-compose-to-x-377664/)

BroX 10-28-2005 04:14 AM

xmodmap å, ä, ö, and ø - or how to add Compose to X
 
Hey all,

being in Scandinavia, I would like to be able to type å, ä, ö, and ø. I've been reading all about xmodmap but can't get it to work. Another possibility would be to enable a Compose key, so that these kind of characters can be made with a",o", o/, etc, if you get what I mean. I tried adding this option to xorg.conf, but it didn't work.

I have an IBM T41 keyboard and would like to use the right_alt key for this compose function so I could create all sorts of characters. Or alternatively, creating alternative a's and o's while pressing right_alt, and shift-right_alt.

How should I go about this?

Cheers, Leon.

sybille 10-28-2005 09:20 AM

What window/desktop manager do you use?
For example, I added the line to define the Multi_key to my ~/.fluxbox/startup script:
Code:

xmodmap -e "keycode 115 = Multi_key"
You could add the command to whatever script starts your desktop/window manager.

As an alternative, you could also define the Multi_key in an /etc/X11/xinit/.Xmodmap file (not present by default), which should be called by the xinitrc of any window/desktop manager. Then it would work for all users, too.

You could also make an .Xmodmap file in the user's home directory. I use the fluxbox startup script instead because I have other things in it - applications that start with fluxbox and some xset commands, for example - and it's easier for me when all of that stuff is in the same file.

Oh, I forgot to mention that you can determine the keycode by running xev from a term and then pressing the key you want to use as Multi_key. It will show you a lot of information, including the keycode for the key. (The key I use, 115, is the Redmond key on my keyboard.)

Once you have defined the compose key (Multi_key) in this way, you can make the alternate characters by using the keys defined in the Compose file for the locale you are using on the system, which can be found in /usr/X11R6/lib/X11/locale/subdirectory-for-your-locale. When I was learning this, I copied over the correct Compose file to my home directory for reference. So, for example, to make a euro symbol, the Compose file I use tells me to press:
Code:

<Multi_key> <e> <equal>        : "\244"        EuroSign
So, I press Redmond, then hold down e and press = : €
There are several alternate keypresses defined for each character. But the point is that they are already defined in the Compose file. I'm sure it's possible to completely remap your keyboard so that you can use any keys you want, but I think that's a different thing altogether. Anyway, I don't know how to do that.

There are other approaches to using the Multi_key, as well. For example, see:
http://www.gentoo.org/news/en/gwn/20...newsletter.xml
(jump to section 8, Tips & Tricks)
But the one I'm using, with the fluxbox startup script, works just fine for me. :)

HTH

BroX 10-30-2005 05:49 PM

Compose - Solved!
 
Thanks sybille,

That's exactly what I needed! Added
Code:

keycode 113 = Multi_key
to ~/.Xmodmap and now I can easily create al characters I want!

I use Fluxbox. Keycode 113 is the right_alt key on Thinkpad keyboard.

Cheers, Leon.

sybille 10-31-2005 08:34 AM

Happy to hear that it worked for you! :)


All times are GMT -5. The time now is 11:07 AM.