LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop
User Name
Password
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.

Notices

Reply
 
LinkBack Search this Thread
Old 05-25-2012, 05:04 PM   #1
SaintDanBert
Senior Member
 
Registered: Jan 2009
Location: Austin, TX
Distribution: Mint-15 with Cinnamon & KDE
Posts: 1,269
Blog Entries: 3

Rep: Reputation: 86
keyboard entry of "accented" characters


Can someone tell me how to enable and configure keyboard entry of "accented" characters such as the French 'e' with acute or grave accent, German 'u' with umlaut, Spanish 'c' with cedilla, etc?

That other software from Redmond will let me enter ALT plus numeric pad "0233" for the French 'e' acute. I cannot get anything similar working with linux.

I suspect that I simply do not know what name the linux world uses to refer to this and similar features.
I'm running Cinnamon on Linux Mint-12 (Ubuntu 11.10).

Thanks is advance,
~~~ 0;-Dan
 
Old 05-25-2012, 05:27 PM   #2
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 1,814

Rep: Reputation: Disabled
Quote:
Originally Posted by SaintDanBert View Post
That other software from Redmond will let me enter ALT plus numeric pad "0233" for the French 'e' acute. I cannot get anything similar working with linux.
That's really something of a hack. The "proper" way to access accented characters (provided they don't have a dedicated key on your keyboard, like the Swedish /), is through "dead keys".

A "dead key" is a key which doesn't produce any output by itself, but acts as a modifier on the next keystroke/character. On my (non-English) keyboard, the ~ key is a dead key. I can produce "" and "" by pressing "~" followed by "o" and "n" respectively. To get the "~" character by itself, I have to press ~ then space.

I know precious little about keyboard settings in X, but some other linuxquestion.org user (or Google) will no doubt be able to point you in the right direction.
 
Old 05-25-2012, 10:07 PM   #3
frankbell
Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Debian, Mageia, Mint
Posts: 6,878

Rep: Reputation: 1267Reputation: 1267Reputation: 1267Reputation: 1267Reputation: 1267Reputation: 1267Reputation: 1267Reputation: 1267Reputation: 1267
ALT-233 looks like a "high ASCII" code (I looked it up; it is).

It's a DOS thing that long predates Windows, going back to when DOS text increased from 128 (ASCII) to 256 ("high" ASCII, "high" meaning "above 128") characters. I suspect that, if Redmond could figure some way to make it go away, they would.

https://en.wikipedia.org/wiki/Extended_ASCII

This might help: http://linux.die.net/man/1/uni2ascii but I have no desire to test it.

Last edited by frankbell; 05-25-2012 at 10:08 PM.
 
Old 05-26-2012, 12:23 PM   #4
DavidMcCann
Senior Member
 
Registered: Jul 2006
Location: London
Distribution: CentOS, Salix
Posts: 2,823

Rep: Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723
Run the keyboard configuration tool in the preferences menu and set a key to use as the Compose key: Windows Menu or Right Control are popular choices. Then you can press the Compose key and the following keystrokes will be looked up in a table to find the accented character you want (see more information in Wikipedia):
Compose + ' + e →
Compose + , + c →
Compose + " + u →
Don't use dead keys: they are a pain on the "American international" keyboard, where you get a dead acute at the expense of having to press the apostrophe twice to get an apostrophe.
 
Old 05-26-2012, 01:04 PM   #5
273
Senior Member
 
Registered: Dec 2011
Location: UK
Distribution: Debian Sid + various in VMs.
Posts: 2,848

Rep: Reputation: 626Reputation: 626Reputation: 626Reputation: 626Reputation: 626Reputation: 626
On my systems <Alt Gr> is the compose key so pressing <Shift> then <Alt Gr> then e then ' gives me .
I think it was this way by default, but this would only apply to Debian based systems.
 
1 members found this post helpful.
Old 05-26-2012, 02:49 PM   #6
SaintDanBert
Senior Member
 
Registered: Jan 2009
Location: Austin, TX
Distribution: Mint-15 with Cinnamon & KDE
Posts: 1,269
Blog Entries: 3

Original Poster
Rep: Reputation: 86
Quote:
Originally Posted by 273 View Post
On my systems <Alt Gr> is the compose key so pressing <Shift> then <Alt Gr> then e then ' gives me . I think it was this way by default, but this would only apply to Debian based systems.
I don't recognize what you refer to as "< ALT Gr >" as a keystroke or a key cap. What might this be?
As I look at my keyboard, I have the following key faces:

Left-Ctrl ... Left-Windows ... Left-ALT ... Right-ALT ... Right-Menu ... Right-Ctrl ... Page-Left ... Page-Right

From the other replies, it seems that I need to search out "Compose Key" as something to enable and configure.

Thanks in advance,
~~~ 0;-Dan
 
Old 05-26-2012, 03:14 PM   #7
273
Senior Member
 
Registered: Dec 2011
Location: UK
Distribution: Debian Sid + various in VMs.
Posts: 2,848

Rep: Reputation: 626Reputation: 626Reputation: 626Reputation: 626Reputation: 626Reputation: 626
Sorry I had forgotten that some keyboards don't have one. It's the right Alt key whcih on my keyboard is labelled "Alt Gr" (which I think stands for Alternative Graphics) so depending on your distribution and setup right Alt may still work as it does for me.
http://en.wikipedia.org/wiki/Alt_gr
 
Old 05-27-2012, 05:36 AM   #8
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Debian sid + kde 3.5 & 4.4
Posts: 6,823

Rep: Reputation: 1946Reputation: 1946Reputation: 1946Reputation: 1946Reputation: 1946Reputation: 1946Reputation: 1946Reputation: 1946Reputation: 1946Reputation: 1946Reputation: 1946
See here for a list of the most common compose key sequences, and a short explanation on how to enable it.

http://www.hermit.org/Linux/ComposeKeys.html

I have also modified and updated the script found on this page for searching the current compose key list on your system. It will output all the combinations that can be used for whatever character(s) you input (probably through cut&paste).

Code:
#!/bin/bash

#####################################################################
# ximkeys.sh (original script name)
# List the X compose sequences available to generate the specified character.
# I.E. the keyboard key sequence to enter after the compose (multi) key or
# a dead key is pressed.
#
# This version has been heavily modified by me (David the H.).  It is now
# bash-specific, reduces the need for external tools (only grep is called on),
# and can handle multiple inputs.
#
# The original script header follows.  The script itself can be found here:
# http://www.pixelbeat.org/docs/xkeyboard/
#
# Author:
#    P@draigBrady.com
# Notes:
#    GTK+ apps use a different but broadly similar input method
#    to X by default. Personally I tell GTK+ to use the X one by
#    adding `export GTK_IM_MODULE=xim` to /etc/profile
# Changes:
#    V0.1, 09 Sep 2005, Initial release
#    V0.2, 04 May 2007, Added support for ubuntu
######################################################################

# test for input, and print usage info if none found
if [[ -z $* ]]; then
	echo "Usage: ${0##*/} 'character(s)'" >&2
	echo "Multiple characters are supported." >&2
	echo "They don't need to be space-separated." >&2
	exit 1
fi

# determine the current language setting.  If not UTF-8, exit with error
re='(.*)[.][Uu][Tt][Ff].*8'
if [[ $LANG =~ $re ]]; then

	lang="${BASH_REMATCH[1]}"
	codeset=UTF-8

else

	echo "Sorry, only UTF-8 is supported at present" >&2
	exit 1

fi

# test for existence of the proper dir and file
dir=/usr/share/X11/locale

if [[ ! -d "$dir" ]]; then #if not found, check for the older X11 dir

	dir=/usr/X11R6/lib/X11/locale

fi

if [[ ! -d "$dir" || ! -r "$dir/locale.dir" ]]; then

	echo "Sorry, couldn't find your X windows locale data" >&2
	exit 1

fi

# extract the correct codepage file from the locale.dir
page="$( grep -m1 "${lang}.${codeset}$" <$dir/locale.dir )"
page=${page%%/*}
file="$dir/$page/Compose"

# loop through input characters, and print all matching entries.
echo

while read -n 1 character; do

	[[ -z $character ]] && continue
	echo "combinations found for [$character]"
	grep -F "\"$character\"" "$file"
	echo

done <<<"$*"

exit 0
I recommend sticking it in a global directory such as /usr/local/bin.
Then just make it executable, and run it like this:

Code:
$ ximkeys.sh 

combinations found for []
<Multi_key> <s> <s>			: ""   ssharp # LATIN SMALL LETTER SHARP S

combinations found for []
<dead_diaeresis> <a>			: ""   adiaeresis # LATIN SMALL LETTER A WITH DIAERESIS
<Multi_key> <quotedbl> <a>		: ""   adiaeresis # LATIN SMALL LETTER A WITH DIAERESIS

combinations found for []
<Multi_key> <Y> <equal>			: ""   yen # YEN SIGN
<Multi_key> <equal> <Y>			: ""   yen # YEN SIGN
<dead_currency> <y>			: ""   yen                 # YEN SIGN

Last edited by David the H.; 05-27-2012 at 05:38 AM.
 
1 members found this post helpful.
Old 05-27-2012, 05:45 AM   #9
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Debian sid + kde 3.5 & 4.4
Posts: 6,823

Rep: Reputation: 1946Reputation: 1946Reputation: 1946Reputation: 1946Reputation: 1946Reputation: 1946Reputation: 1946Reputation: 1946Reputation: 1946Reputation: 1946Reputation: 1946
Quote:
Originally Posted by frankbell View Post
ALT-233 looks like a "high ASCII" code (I looked it up; it is).
I was always under the impression that the number used in the Windows keypad input was the unicode decimal code point. [] is unicode 233 as well. I could be wrong though, as I never used it myself.

Last edited by David the H.; 05-27-2012 at 05:56 AM.
 
Old 05-27-2012, 11:44 AM   #10
DavidMcCann
Senior Member
 
Registered: Jul 2006
Location: London
Distribution: CentOS, Salix
Posts: 2,823

Rep: Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723
For the record, if you need custom compose sequences, you don't need to run a script. Just copy the existing file (mine lives at /usr/share/X11/locale/en_US.UTF-8/Compose) to ~/.XCompose and then edit it. Ensure that your input module is xim (and not the the GTK one usually installed by default in Gnome distros): putting GTK_IM_MODULE=xim in /etc/environment should work.
 
Old 06-15-2012, 05:21 PM   #11
SaintDanBert
Senior Member
 
Registered: Jan 2009
Location: Austin, TX
Distribution: Mint-15 with Cinnamon & KDE
Posts: 1,269
Blog Entries: 3

Original Poster
Rep: Reputation: 86
Following the combined advice from these responses, I was able to solve my troubles.

On my Mint-12 with Cinnamon (sounds tasty...) workstation, I did:
  • Desktop: System Menu --> Preferences --> Keyboard Layout
  • Keyboard Layout: Layouts tab --> select English(US) --> select Options buttons
  • select Compose Key Position
  • set check box for desired key I used Scroll Lock

I then made a local copy of the dot-XCompose file in my $HOME so that I could know and control what was available. I removed all of the Asian and similar language characters, and added a few of my special desirables.

Thanks to all,
~~~ 0;-Dan
 
1 members found this post helpful.
Old 06-15-2012, 09:23 PM   #12
frankbell
Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Debian, Mageia, Mint
Posts: 6,878

Rep: Reputation: 1267Reputation: 1267Reputation: 1267Reputation: 1267Reputation: 1267Reputation: 1267Reputation: 1267Reputation: 1267Reputation: 1267
Thanks for coming back and posting the end of the story. If someone else comes along with that question, LQ is now ready.
 
Old 06-16-2012, 12:54 PM   #13
SaintDanBert
Senior Member
 
Registered: Jan 2009
Location: Austin, TX
Distribution: Mint-15 with Cinnamon & KDE
Posts: 1,269
Blog Entries: 3

Original Poster
Rep: Reputation: 86
Quote:
Originally Posted by frankbell View Post
Thanks for coming back and posting the end of the story. If someone else comes along with that question, LQ is now ready.
It is too easy to grab your solution and run with it and then forget to close the loop.
Maybe LQ could "nag" the original poster after no activity for a while..

Glad you noticed. More glad I remembered...
~~~ 0;-Dan
 
  


Reply


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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Strange "characters" appearing in auto "created" man pages Sector11 Linux - General 7 02-28-2010 11:05 AM
Accented Characters and other "foreign language" Characters Mark_in_Hollywood LQ Suggestions & Feedback 2 04-30-2007 06:10 PM
Spanish accented characters in an English keyboard (Xubuntu)? joseantmm Ubuntu 2 01-23-2007 09:04 AM
KDE, foreign language keyboard give wierd characters like "qué tal estás?" lefty.crupps Linux - Software 2 07-06-2006 12:17 PM
"Shorty" keyboard entry in xorg.conf aes canis Linux - Hardware 0 05-26-2005 06:20 AM


All times are GMT -5. The time now is 02:20 PM.

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