You are not logged in.

#1 2013-01-21 21:29:42

kilmister
Member
Registered: 2012-01-28
Posts: 22

[Solved] Add a single Spanish letter to my non-Spanish keyboard layout

Hi,

I correspond with Spanish speaking people a lot. They have some special letters like accented vocals (á, í, ó and the likes). I can enter those with my deadkeys accent followed by a vocal, even though my natural keyboard layout is German.

The only problem I have is the ñ. I'd love to have this mapped to AltGr+n. This combo is currently mapped to the weird character ”, which I don't really need.

My question: Using LXDE/openbox, how can I best map AltGr+n to the ñ character?

Thanks in advance,
Alex

Last edited by kilmister (2013-01-22 13:24:22)

Offline

#2 2013-01-21 22:02:31

chris_l
Member
Registered: 2010-12-01
Posts: 390

Re: [Solved] Add a single Spanish letter to my non-Spanish keyboard layout

You will need to create your own xkb layout, which is going to be based on the one you are using right now, but with that small change.

Read the XKB article from the wiki.

Btw, the result will work on X, no matter your DE/WM.


"open source is about choice"
No.
Open source is about opening the source code complying with this conditions, period. The ability to choose among several packages is just a nice side effect.

Offline

#3 2013-01-21 22:09:28

alphaniner
Member
From: Ancapistan
Registered: 2010-07-12
Posts: 2,810

Re: [Solved] Add a single Spanish letter to my non-Spanish keyboard layout

I think you could just put an xmodmap command in your .xinitrc.


But whether the Constitution really be one thing, or another, this much is certain - that it has either authorized such a government as we have had, or has been powerless to prevent it. In either case, it is unfit to exist.
-Lysander Spooner

Offline

#4 2013-01-22 07:10:15

altercation
Member
From: Seattle
Registered: 2011-05-15
Posts: 136
Website

Re: [Solved] Add a single Spanish letter to my non-Spanish keyboard layout

This sounds like you really want to use xmodmap. If it's just one or two keys, I'd probably just assign them via direct xmodmap commands in your .xinitrc file.

First run `xmodmap -pke`, grepping for the key your want to modify. See the arch wiki page on xmodmap for the level you'll use: https://wiki.archlinux.org/index.php/Xmodmap

The you can call xmodmap for that single key as a test (example only from my own xmodmap -pke output):

xmodmap -e "keycode  38 = a A Greek_alpha Greek_ALPHA aacute Aacute"

So you could change the Greek_alpha in this case to an uppercase Q:

xmodmap -e "keycode  38 = a A Q Greek_ALPHA aacute Aacute"

If it's just one or two changes I find it easier to use `xmodmap -e ...` in .xinitrc rather than create an entirely new xmodmap file to use.


Ethan Schoonover
Precision Colors - http://ethanschoonover.com/solarized

Offline

#5 2013-01-22 13:24:07

kilmister
Member
Registered: 2012-01-28
Posts: 22

Re: [Solved] Add a single Spanish letter to my non-Spanish keyboard layout

Thanks, I added the following line to my ~/.xinitrc and now everything works perfect!

xmodmap -e "keycode 57 = n N n N ntilde Ntilde ntilde"

Offline

Board footer

Powered by FluxBB