Home » Questions » Computers [ Ask a new question ]

How to type special characters in Linux?

How to type special characters in Linux?

In windows there is possibility to type from keyboard special signs by holding alt key and typing a few numbers, that depends on with sign you want to use. Does it work with linux in the same way?

Asked by: Guest | Views: 317
Total answers/comments: 4
Guest [Entry]

You can use Ctrl + Shift + u followed by the code in hex. (You only need to hold down Ctrl and Shift while typing the code)
Guest [Entry]

"Inputting Unicode characters in Linux varies. The UTF-8 and Unicode FAQ has a section containing different input methods:

Ctrl+Shift+U [unicode in hex] is defined in ISO 14755 and implemented by GTK2+, and works in GNOME-Terminal and other applications.
Ctrl+V u [unicode in hex] works in VIM.
Alt+[unicode in decimal using numpad digits] works at the console providing your environment is properly configured to expect UTF-8 (via LOCALE or LANG environment variables). (unicode_start manpage).

Other methods you could use:

Cut-n-paste characters from a small input file containing the characters you want.
Use xmodmap to remap keys in X (see the FAQ link above for examples)."
Guest [Entry]

"There's a better method for both Linux and Windows than using alt-key codes that doesn't require you to remember any codes. It's described in detail here.

The gist is that you use AutoHotKey (Windows) or AutoKey (Linux). Both run in the background and accept arbitrary strings as trigger to run a command, which in this case is to send a special character to the clipboard and then paste it to whatever program is currently being used.

The example given has /delta as the trigger (including the forward slash). After typing those six characters, they are deleted and replaced with a δ."
Guest [Entry]

"If you are a US key user and need to type special characters infrequently, I recommend switching your keyboard layout to the ""us(altgr-intl)"" variation-- that's XKB notation. Your keyboard will work normally unless you hold the right Alt key, also known ""AltGr"", then you will mostly be able to access the extra characters shown in blue here:

I say ""mostly"" because that's a screenshot of the main US International layout. I found the details of the ""altgr-intl"" variation defined in this file on Arch Linux: /usr/share/X11/xkb/symbols/us: Here are the differences defined there:
// five dead keys moved into level3:

┊key <TLDE> { [ grave, asciitilde, dead_grave, dead_tilde ] };
┊key <AC11> { [apostrophe,quotedbl, dead_acute, dead_diaeresis ] };

// diversions from the MS Intl keyboard:

┊key <AE01> { [ 1, exclam, onesuperior, exclamdown ] };
┊key <AD04> { [ r, R, ediaeresis, Ediaeresis ] };
┊key <AC07> { [ j, J, idiaeresis, Idiaeresis ] };
┊key <AB02> { [ x, X, oe, OE ] };
┊key <AB04> { [ v, V, registered, registered ] };

// onequarter etc (not in iso8859-15) moved to get three unshifted deadkeys:

┊key <AE06> { [ 6, asciicircum, dead_circumflex, onequarter ] };
┊key <AE07> { [ 7, ampersand, dead_horn, onehalf ] };
┊key <AE08> { [ 8, asterisk, dead_ogonek, threequarters ] };

This alternate layout doesn't have the additional ""dead keys"" that the main International layout does.
The four columns in each array are Regular, Shifted, AltGr, AltGr Shifted.
So for example to type ¡ I press ""<Shift-AltGr-1>"".
You can search for an image of the US International layout until you remember the locations of the symbols you need."