Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 11-26-2004, 03:21 AM   #1
Registered: Apr 2004
Location: Netherlands
Distribution: Mandrake 10.1
Posts: 43

Rep: Reputation: 15
How do I insert special character with alt?

I've seen this question asked a few times before, but in different ways so here goed. In Windows you can insert a special character (accented e for instance) by pressing ALT and tapping in the ASCII code for the character. I haven't found a way to do this in Linux yet, but I can't believe no one has ever made a bit of code to produce this behaviour, I think I'm just unable to find it. So here's my question: does anyone know where I can find an applet (or something) that emulates the DOS behaviour of ALT+code=insert special character.

(This is not intended to be insulting, but I'm not looking for a workaround or a tutorial on mapping keys, I've found plenty of those. If you can tell me that the above behaviour is simply impossible in Linux, al least I can stop wasting my time looking for it, so I'd be grateful for that too.)
Old 11-26-2004, 03:41 AM   #2
Senior Member
Registered: Jul 2004
Distribution: Ubuntu 7.04
Posts: 1,991

Rep: Reputation: 76
It's not impossible to do (what is in Linux?!?) but I haven't found anything to do this after a cursory Freshmeat search.

With the current abstration layers in Linux, this isn't something that's very easy to do.

One problem is that you've no idea which character set the kernel is configured to use natively; it could be a simple 8-bit ASCII varient, 16-bit unicode or (most commonly with new distros) UTF-8, where most characters are 8 bits but some are 16. 8-bit codes range from 0 to 255, while 16-bit codes go up to 65535, so how many numbers should you type in? Also, the character mappings are different for the terminal than they are for X-Windows, because of the event-driven nature of X.

IMHO, the Alt-number combination is really just a Windows work-around for the difficulty of mapping a scancode to a keycode (you have to design an entire character set and then load it all, so changing one key isn't portable across different character sets). It may be slightly more work initially to map a new character in Linux or X, but it does mean that you can actually type properly with the new character.
Old 11-26-2004, 03:47 AM   #3
Registered: Apr 2004
Location: Netherlands
Distribution: Mandrake 10.1
Posts: 43

Original Poster
Rep: Reputation: 15
Thanks for the quick and complete reply, although it did kill my ambition to quickly program this 'simple applet' myself I'll start mapping keys then.
Old 11-27-2004, 06:29 PM   #4
Senior Member
Registered: Jul 2004
Distribution: Ubuntu 7.04
Posts: 1,991

Rep: Reputation: 76
If you just want a Windows-compatibility alt-key applet, then that's not too hard; you just assume that the user's using ISO-8859-1 or whatever. (It would be better to make the codepage be selectable)
Old 05-17-2006, 10:19 AM   #5
Registered: May 2006
Location: Bayern, Germany
Distribution: Many
Posts: 224

Rep: Reputation: 41
But it works for the "Text Mode"! Is there any method to make it work on X-Windows too?
Old 05-17-2006, 10:42 AM   #6
LQ 5k Club
Registered: May 2003
Location: London, UK
Distribution: Debian "Testing"
Posts: 6,110

Rep: Reputation: 412Reputation: 412Reputation: 412Reputation: 412Reputation: 412
Some unusual characters are already mapped to the key combination [Right "Alt GR" Key] & [Another key].
Eg try [Right "Alt GR" Key] and m - you get the greek mu symbol:
I don't think all keys are mapped, and I do not know where this happens.



Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
block special and character special files s_shenbaga Linux - Newbie 4 06-23-2015 02:16 AM
How do I get Right-Alt key to be just Alt and not generate special characters? (KDE) KWTm Linux - General 2 06-25-2005 09:26 PM
how to insert special characters set2004 Linux - Newbie 2 08-05-2004 10:50 AM
special character boolim Linux - General 1 08-29-2003 09:57 AM
i need help with a special character Hone101 Linux - Newbie 1 05-03-2003 07:21 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:51 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration