Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
How do you type special characters in Linux? The method in Windows is to hold down the Alt key and then type the 4-digit code, e.g., Alt+0246 for ö. But that doesn't seem to work, at least not when I try it on a command line or in an editor (under KDE at least) on my laptop.
Well, how did I type the ones in this very message, you may ask? I copied and pasted them from a code chart, but that's a very awkward way to do it. There must be something better, but I don't know what it is and I don't even know what topic in the various helps would have the information.
Last edited by pwabrahams; 10-28-2007 at 03:21 PM.
Reason: clarity
If you are using OpenOffice.org Writer, from the menu Insert - Special Character. Pick the character from the dialogue box that pops up.
If you are using vim, add this to your .vimrc
:set digraph
When writing in vim, to use the digraph feature, from the command prompt enter ':digraph' without quotes. You will be presented with a chart of digraph characters. They consist of two letter/character keys with a backspace between.
So, A <backspace> E would give the Æ. You can get more help from vim with the command :help digraph.
If there is a way to do the same in the bash shell, I haven't found it yet.
Last edited by bigrigdriver; 10-28-2007 at 04:12 PM.
I actually want to create filenames in Konqueror that are foreign-language titles of CD tracks. So I'm looking for a method that doesn't rely on particular programs. If Windows can do it with the Alt--xxxx method, then surely there ought to be a way to do the same thing in Linux as easily!
Search (the fora and the web) for “Compose Key” (IMO more elegant than Alt+xxxx). For example, on my setup, to type Æ, type the following:
Code:
<Compose>,<Shift>+<a>,<Shift>+<e>
(where comma indicates press-and-release, and the plus-sign indicates press-and-hold until the next keypress)
As you can see the idea of the compose key is to compose complicated characters from simpler characters (so Æ is the combination of a capital A and a capital E). Likewise, ö is the composition of the straight double quotes " (on a US keyboard it’s <Shift>+<'>) with lowercase o. The compose key should work in plain X (i.e., wm-independent), but it might take some tweaking to work seamlessly with gtk apps and qt/kde apps. Additionally, once you get the Compose key working, it is trivial to add your own compositions for characters you may use but for which there is no predefined sequence.
If you want something more powerful than X’s compose key (technically part of the X Input Method), you might try a different input method (e.g., the Smart Common Input Method).
You can set your keyboard to support international characters through composition. e.g. typing "o is interpretted as ö, `e turns into an è and so on.
The keyboard layouts which do this are called things like "international with dead keys". You can set up multiple layouts and swap between them using a global keyboard shortcut or with the systray keyboard switcher.
Here's the step by step to setting this up:
open the KDE control centre (from the K menu or by running kcontrol)
navigate to regional and language -> keyboard layout, select "enable keyboard layouts".
you will have your normal keyboard layout in the "active layouts" list. You can simply change the variant to "intl", or you can leave the default as it is, and add an additional layout for the times when you want to enable character composition. This is what I do.
An alternative is simply to add a normal keyboard layout for a different country which supports the characters you want to use. This will be very hard to use unless you have a good memory though!
You can choose if the layout should be global (affects all applications) or if KDE keeps track of the keyboard layout per application in the "switching options" tab. I prefer global, but it's up to you.
Apply the changes and you should see a little flag icon in your systray which is an indicator for the current layout.
You can add a global keyboard shortcut to switch active keyboard layout from the "leyboard and mouse -> keyboard shortcuts panel. I use control+alt+space.
I hope that is clear - explaining GUI operations with text is difficult.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.