Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Easy accents in X11
View unanswered posts
View posts from last 24 hours

Goto page Previous  1, 2  
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
mixandgo
n00b
n00b


Joined: 05 Apr 2005
Posts: 23

PostPosted: Wed Apr 13, 2005 4:44 pm    Post subject: Reply with quote

is there a way I could map CTR+c+<key> ?? I use this combination in emacs a lot for accented chars and it would be nice to have it everywhere in X.
Back to top
View user's profile Send private message
grant.mcdorman
Apprentice
Apprentice


Joined: 29 Jan 2003
Posts: 295
Location: Toronto, ON, Canada

PostPosted: Wed Apr 13, 2005 5:19 pm    Post subject: Reply with quote

mixandgo wrote:
is there a way I could map CTR+c+<key> ?? I use this combination in emacs a lot for accented chars and it would be nice to have it everywhere in X.
(I presume you mean Control+C, followed by some other key) Not likely; I don't know of a way offhand to make a multi-key press into the Compose or AltGr key. Even if there is, you'd be dedicating Control+C for that purpose - i.e. Emacs wouldn't see it any more.

Put it another way: you want CTR+c+<key> to send an accented character (i.e. 8-bit Latin-1) to the application... except not always, since this'd break a lot of things, not least of which would be the ability to Control+C in a shell window, and all Emacs Control+C sequences.

Note that in a console window, as far as I know Emacs, by default, treats Esc+char the same as the equivalent char with the high-order bit set; i.e. é is, to Emacs, Esc+i. I don't know what the X version of Emacs does in this case, though, and I don't have one handy to test.
Back to top
View user's profile Send private message
Vann
Guru
Guru


Joined: 04 Aug 2002
Posts: 357

PostPosted: Thu Apr 14, 2005 3:12 pm    Post subject: Reply with quote

Gherald wrote:
I just want working Alt+### codes.


Why oh why? I was so thankful when I learned about the compose key. In Gnome I just select "Menu is compose" from the keyboard control panel and the otherwise useless menu key allows me tö tÿpè åll sôrtß ºf thïñgs that before required me to memorize a bunch of unrelated 4-digit numbers.
Back to top
View user's profile Send private message
phsdv
Guru
Guru


Joined: 13 Mar 2005
Posts: 372
Location: Europe

PostPosted: Sat Apr 16, 2005 10:58 am    Post subject: Reply with quote

tom56 wrote:
alt gr + s = ß
alt gr + [ then o = ö
alt gr + 3 = €

hmmm, does something else for me. First of all I do not have an [alt gr] key, but normally this is the right [alt] key.
Further [alt right] does not work as [alt gr] on my PC, it thinks it is the [alt] key. But in a xterm I get:
Code:
alt + e = å
alt + a = á
alt + s = ó
alt + g = ç

my /etc/X11/xorg.conf:
Code:
Section "InputDevice"
    Identifier  "Keyboard1"
    Driver      "kbd"
    Option "AutoRepeat" "500 30"
    Option "XkbModel"   "pc105"
    Option "XkbLayout"  "us"
EndSection

I am learning french but my keyboard is qwerty, so some support for accents would be nice. And I am not ready yet to switch to a azerty keyboard, those really s*** for programming.
Back to top
View user's profile Send private message
grant.mcdorman
Apprentice
Apprentice


Joined: 29 Jan 2003
Posts: 295
Location: Toronto, ON, Canada

PostPosted: Sat Apr 16, 2005 4:18 pm    Post subject: Reply with quote

phsdv wrote:
But in a xterm I get:
Code:
alt + e = å
alt + a = á
alt + s = ó
alt + g = ç
That's just the character with the high bit set. For proper international characters you need either a dedicated Alt Gr key (as tom56 uses) or a dedicated Compose key; I prefer the latter and use the Windows Menu key. Then I can do:
Code:
Menu, e, ' = é
(note that this is not simultaneous presses, but sequential).

The relevant section of Xorg.conf is:
Code:
Section "InputDevice"

    Identifier  "Keyboard1"
    Driver      "kbd"

    Option "AutoRepeat" "500 30"

# Specify which keyboard LEDs can be user-controlled (eg, with xset(1))
    Option      "Xleds"      "1 2 3"

    Option "XkbModel"   "pc101"
    Option "XkbLayout"  "us"
    Option "XkbOptions" "ctrl:nocaps,compose:menu,grp_led:caps"

EndSection
Specifically, the compose:menu is the critical bit. You can also use the right/left Alt or Windows keys for the compose key by putting ralt, lalt, rwin, or lwin, if I recall correctly. The rest is just my setup, which of course you shouldn't need.

Compose sequences are all two-character sequences and are, for the most part, pretty self evident. I have a complete table of the sequences if you're interested.
Back to top
View user's profile Send private message
phsdv
Guru
Guru


Joined: 13 Mar 2005
Posts: 372
Location: Europe

PostPosted: Sat Apr 16, 2005 6:48 pm    Post subject: Reply with quote

Great, I like the cômpose kèy! Ça marche tries bien! (=it works very good) Even ë, Ë works and ñ, ø etc.
Back to top
View user's profile Send private message
davecs
Guru
Guru


Joined: 08 Nov 2003
Posts: 436
Location: Dagenham, GB

PostPosted: Mon Apr 18, 2005 8:43 pm    Post subject: Reply with quote

I've made a few discoveries.

(1) For the Right-Alt key to be your Third Level Chooser, and the Menu key to be compose, you can add this line in /etc/X11/xorg.conf to the InputDevice Keyboard section:

Code:
    Option "XkbOptions" "lv3:ralt_switch,compose:menu"


I mentioned in an earlier post that the "fallback" keys (ie basic American) are defined in this file: /usr/lib/X11/xkb/symbols/pc/latin which you can edit. You can use this to set your own symbols at the third and fourth levels (fourth level Right-Alt + Shift + key).

Now the compose key. This is defined according to your locale, for US and Britain it is: /usr/lib/X11/locale/iso8859-1/Compose, for the rest of Western Europe it could be /usr/lib/X11/locale/iso8859-15/Compose and I'm sure you get the pattern. Well if you investigate the other Compose files in the other locale directories, you can copy lines from them to your one.

Now if you tamper with these files, remember, don't just back them up, but back up your version as well. Backup original in case you b0rk it, backup your version because upgrading x11-xorg will overwrite the files and you will need to restore them.

Anyway, using all this I have created a great "International British Keyboard" and though I cannot speak , for example Turkish or Maltese, at least I can copy-type and spell place-names correctly.

Have fun!

PS Maltese place names: Żebbuġ / Ġgantija / Għajn-tuffieha hee-hee!
_________________
Gentoo, PCLOS-pre-81a and Windows 98SE.
Shuttle SN41G2V2
Athlon XP2500+ o/c to 3200+, 2x256Mb Geil Value RAM, FX5200.
Ntlworld cable internet via ethernet
and PC-Chips Desknote Laptop (with PCLOS-pre-81a )
Back to top
View user's profile Send private message
mixandgo
n00b
n00b


Joined: 05 Apr 2005
Posts: 23

PostPosted: Mon Apr 18, 2005 9:20 pm    Post subject: Reply with quote

I have a problem. Maybe anyone can help me, I don't know what keyboard I have so I can tell X I've mapped all my keys manually beacuse of this.

I have an HP/COMPAQ NC6000
Back to top
View user's profile Send private message
davecs
Guru
Guru


Joined: 08 Nov 2003
Posts: 436
Location: Dagenham, GB

PostPosted: Mon Apr 18, 2005 10:59 pm    Post subject: Reply with quote

mixandgo wrote:
I have a problem. Maybe anyone can help me, I don't know what keyboard I have so I can tell X I've mapped all my keys manually beacuse of this.

I have an HP/COMPAQ NC6000


Simple rule of thumb:

pc104 = American Keyboard (ie the Enter key is like a reversed "L")
pc105 = European Keyboard (ie the Enter key and another key, # in Britain, replace the American enter key)

pc101 and pc102 are the same but without Windows keys, but in reality pc105 works with most pc keyboards, as it allows for the extra keys but if they aren't there it doesn't really matter!

If that don't work then I don't know.
_________________
Gentoo, PCLOS-pre-81a and Windows 98SE.
Shuttle SN41G2V2
Athlon XP2500+ o/c to 3200+, 2x256Mb Geil Value RAM, FX5200.
Ntlworld cable internet via ethernet
and PC-Chips Desknote Laptop (with PCLOS-pre-81a )
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum