Help me customize keyboard for Spanish language


asimov-solensan

Very Active Member
Joined
Jan 8, 2010
Messages
741
I try to use Pyra for productivity, which means in my case, writing in Spanish and Catalan, and actual layout is not adapted to those languages but it requires just a few changes. Allow me to develop.

We may have diacritics in all the bowels: á é í ó ú and also à è ò

In our keyboards this is managed with keys ` and ´ . They do not write directly the single quote, you click once and the system waits for additional input, if it is a bowel you get the bowel combined with the correct diacritic. And if it is a space you get the quote alone. Can I configure this behavior in Pyra?

Additionally I miss two symbols we use, ñ and · Which I think can be mapped to USR1 and USR2, but I do not know exactly how to do this.

There are other things but like ü and ç but they are already included in a convenient way in the keyboard.

And yes, I know about the compose key. It is fine if I use it eventually, and it was enough in Pandora. But Pyra opens the so many use cases that I totally need to make the layout more comfortable for me.
 
Some hints.... only.


My /etc/keymap that can be or ought to be adapted (US only):

Code:
#     1,     2,       4,   8
# Shift, AltGr, Control, Alt
keymaps 0,1,4,8

# Special keys.

keycode  29 = Control
keycode  56 = Alt
#keycode  464 = AltGr

#           Default         Shift

keycode  51 = comma                less
keycode  52 = period        greater

# Number Bar

keycode  2 = one                section
keycode  3 = two                braceleft
keycode  4 = three              braceright
keycode  5 = four               asciitilde
keycode  6 = five               percent
keycode  7 = six                asciicircum
keycode  8 = seven              ampersand
keycode  9 = eight              asterisk
keycode  10 = nine              bracketleft
keycode  11 = zero              bracketright
keycode  14 = BackSpace         Remove

# Fn stuff

# F13 - Fn-J
keycode  183 = apostrophe
# F14 - Fn-B
keycode  184 = bar
# F15 - Fn-Y
keycode  185 = underscore
# F16 - Fn-V
keycode  186 = numbersign
# F17 - Fn-T
keycode  187 = exclam
# F18 - Fn-K
keycode  188 = sterling
# F19 - Fn-S
keycode  189 = quotedbl
# F20 - Fn-W
keycode  190 = at
# F21 - Fn-.
keycode  191 = colon
# F22 - Fn-N
keycode  192 = dollar
# F23 - Fn-M
keycode  193 = currency
# Fn-L
keycode  124 = yen
# Fn-X
keycode  214 = question
# Fn-E
keycode  26 = parenleft
# Fn-R
keycode  27 = parenright

# Listing these here in short notation gives us modifier keys

keycode  16 = +q
keycode  17 = +w
keycode  18 = +e
keycode  19 = +r
keycode  20 = +t
keycode  21 = +y
keycode  22 = +u
keycode  23 = +i
keycode  24 = +o
keycode  25 = +p
keycode  30 = +a
keycode  31 = +s
keycode  32 = +d
keycode  33 = +f
keycode  34 = +g
keycode  35 = +h
keycode  36 = +j
keycode  37 = +k
keycode  38 = +l
keycode  44 = +z
keycode  45 = +x
keycode  46 = +c
keycode  47 = +v
keycode  48 = +b
keycode  49 = +n
keycode  50 = +m

# DPad - URDL

alt keycode 106 = Incr_Console
alt keycode 105 = Decr_Console

Under console, /etc/keymap helps with loadkeys.

xmod for x11 or setup with setxkbmap es

(...)

more inputs from others is needed to get fully answer.
 
We may have diacritics in all the bowels: á é í ó ú and also à è ò
I try to have them in my vowels, but I guess it depends on what I write.:p

In our keyboards this is managed with keys ` and ´ . They do not write directly the single quote, you click once and the system waits for additional input, if it is a bowel you get the bowel combined with the correct diacritic. And if it is a space you get the quote alone. Can I configure this behavior in Pyra?
I think that was called "dead key" in case you want to look it up.
The nostalgic in me had to bring out the Catalan-HOWTO, but keep in mind it's for archeological purposes, it's more than 20 years old.
Additionally I miss two symbols we use, ñ and · Which I think can be mapped to USR1 and USR2, but I do not know exactly how to do this.
Not sure where USR1 and USR2 would be. Is this page up to date ?
I think I'd like to set up 3 dead keys for diaeresis/umlaut("), acute accent (') and grave accent (`) and then type middot (·) by pressing one of those and then "l" or "."
(I never got too deep into the debate on "ŀl/l·l/whatever" but I think it boils down to middot, not Ldot, at least for typing and coding), and I would get "ñ" by pressing one of those dead keys and "n" (because I can't write in languages that have "ń" or "ǹ").
Maybe it's suboptimal, and just copies what I'm used to in other keyboards.
But I won't know what I want until I have a Pyra and can try different options.
There are other things but like ü and ç but they are already included in a convenient way in the keyboard.
Yes. I wonder if I'll get use to type ü like that, though. I have to try.
And yes, I know about the compose key. It is fine if I use it eventually, and it was enough in Pandora. But Pyra opens the so many use cases that I totally need to make the layout more comfortable for me.
I agree
 
I think the Pyra was designed to have a compose key allocated by default, but the OP stated that making better use of the available keys to make it more like an international keyboard would be preferable.
 
Btw, for Catalan one needs ï too (unlike German). For instance: "Les veïnes no són tan roïnes, han dut raïm per amor al proïsme.".
And for Spanish one needs ¿ and ¡ like in "¡Vaya! ¿Aún se usa?"
But maybe one can live with compose for those, they're relatively rare ?
 
the OP stated that making better use of the available keys to make it more like an international keyboard would be preferable.
Thanks Levi. In a (probably drunken) stupour, I somehow missed that :$.
 
I try to have them in my vowels, but I guess it depends on what I write.:p
Ha ha, I need a context aware spell check.

Thanks a lot for your inputs. I have got some clues but I'm stuck.

First we have got the file. ~/.Xmodmap that shows the actual Pyra configuration. An there is the line "keycode 8" whith no default mapping which seems to indicate this is the Usr key. Sadly it does not respond to changes. I tried mapping it to h H for instance but after loging out and in again it ignores the change.

Then regarding the dead keys. It is managed by ~/XCompose (file non-existing by default in Pyra). I created the lines to manage diacritics in "a".

Code:
dead_acute> <a> : "á"
<dead_grave> <a> : "à"

But again the change does nothing.

Also other things people mentioned.

ï : I totally forgot about this one. I guess it can be also managed by .XCompose

¿ and ¡ : I can live without them. Even on formal emails it accepted to ignore them. But if someone thinks a way to implement them that would be lovely.
 
First we have got the file. ~/.Xmodmap that shows the actual Pyra configuration. An there is the line "keycode 8" whith no default mapping which seems to indicate this is the Usr key. Sadly it does not respond to changes. I tried mapping it to h H for instance but after loging out and in again it ignores the change.
but did you run xmodmap .Xmodmap or some such ?
I'm not sure this file is read by default.
Then regarding the dead keys. It is managed by ~/XCompose (file non-existing by default in Pyra). I created the lines to manage diacritics in "a".
~/.XCompose, with a dot
Code:
dead_acute> <a> : "á"
<dead_grave> <a> : "à"
there's a "<" missing, but I guess it's a typo in your post, not in your file. The question is whether you have dead_grave and dead_acute mapped to some keycode.
I don't think there're dead keys in the default Pyra mapping ?
you could try to run
xev
click on the window that opens and type on a key to see what code it generates.
if it's not generating dead_acute or dead_grave then you need to key mapping, not compose.
 
but did you run xmodmap .Xmodmap or some such ?
I'm not sure this file is read by default.
Just tested and it has no effect. Right now I set .Xmodmap this way:

keycode 133 = Mode_switch
keycode 8 = q Q degree Q
keycode 9 = Escape NoSymbol Print
keycode 10 = 1 exclam F1 exclam
keycode 11 = 2 at F2 at
keycode 12 = 3 numbersign F3 numbersign
keycode 13 = 4 dollar F4 dollar
keycode 14 = 5 percent F5 percent
keycode 15 = 6 asciicircum F6 asciicircum
keycode 16 = 7 ampersand F7 ampersand
keycode 17 = 8 asterisk F8 asterisk
keycode 18 = 9 parenleft F9 parenleft
keycode 19 = 0 parenright F10 parenright
keycode 22 = BackSpace BackSpace BackSpace BackSpace
keycode 23 = Tab ISO_Left_Tab Caps_Lock ISO_Left_Tab
keycode 24 = q Q degree Q
keycode 25 = w W section W
keycode 26 = e E EuroSign E
keycode 27 = r R egrave Egrave
keycode 28 = t T eacute Eacute
keycode 29 = y Y agrave Agrave
keycode 30 = u U ccedilla Ccedilla
keycode 31 = i I diaeresis I
keycode 32 = o O udiaeresis Udiaeresis
keycode 33 = p P ssharp P
keycode 36 = Return NoSymbol Return
keycode 37 = Control_L NoSymbol Control_L
keycode 38 = a A question A
keycode 39 = s S plus S
keycode 40 = d D underscore D
keycode 41 = f F braceleft F
keycode 42 = g G braceright G
keycode 43 = h H bar H
keycode 44 = j J asciitilde J
keycode 45 = k K odiaeresis Odiaeresis
keycode 46 = l L adiaeresis Adiaeresis
keycode 47 = semicolon colon semicolon colon
keycode 48 = apostrophe quotedbl colon quotedbl
keycode 49 = grave asciitilde grave asciitilde
keycode 50 = Shift_L NoSymbol Shift_L
keycode 51 = backslash bar backslash bar
keycode 52 = z Z equal Z
keycode 53 = x X minus X
keycode 54 = c C bracketleft C
keycode 55 = v V bracketright V
keycode 56 = b B backslash B
keycode 57 = n N grave N
keycode 58 = m M acute M
keycode 59 = comma less semicolon less
keycode 60 = period greater slash greater
keycode 65 = space NoSymbol Multi_key
keycode 66 = Caps_Lock NoSymbol Caps_Lock
keycode 95 = F11 F11 F12 F11 F11 F11 XF86Switch_VT_11

Mapping usr to "q" just as a test.

you could try to run
xev
click on the window that opens and type on a key to see what code it generates.
if it's not generating dead_acute or dead_grave then you need to key mapping, not compose.
Yes the filename and code where typos. It is correct in the system.

With xev the USR key gives me keycode 127 and 128. I guess I was wrong with .Xmodmap.

And the output for acute and grave:
KeyRelease event, serial 38, synthetic NO, window 0x3c00001,
root 0x3af, subw 0x0, time 851361, (479,545), root:(485,617),
state 0x0, keycode 49 (keysym 0x60, grave), same_screen YES,
XLookupString gives 1 bytes: (60) "`"
XFilterEvent returns: False

KeyPress event, serial 38, synthetic NO, window 0x3c00001,
root 0x3af, subw 0x0, time 851897, (479,545), root:(485,617),
state 0x0, keycode 203 (keysym 0xb4, acute), same_screen YES,
XLookupString gives 2 bytes: (c2 b4) "´"
XmbLookupString gives 2 bytes: (c2 b4) "´"
XFilterEvent returns: False

So you are telling instead acute and grave it should say dead_acute and dead_grave? And this can be replaced directly in .Xmodmap?
 
Just tested and it has no effect. Right now I set .Xmodmap this way:

keycode 133 = Mode_switch
I don't find 133 in the Pyra keyboard. You may know better ?
keycode 8 = q Q degree Q
Is 8 supposed to be USR then ? I kind of don't understand where the keycodes come from.
I have trouble understanding the rest of keycode assignments.
keycode 57 = n N grave N
keycode 58 = m M acute M
Try maybe
keycode 57 = n N dead_grave N
keycode 58 = m M dead_acute M
although I don't see why you would want them there. 57 is space and 58 isn't any key ?
Maybe better:
keycode 48 = b B dead_grave B
keycode 49 = m M dead_acute M
Maybe just put these two in .xmodmaprc and run xmodmap .xmodmaprc, then try to press
AltGr+b and after a to see if you get an à
If this work we can get further from here.
Mapping usr to "q" just as a test.
So keycode 8 is USR for you ?

With xev the USR key gives me keycode 127 and 128. I guess I was wrong with .Xmodmap.
I don't understand it at least. Am I getting you lost? Maybe it's me who doesn't understand how it works,
I just read man xmodmap and man XCompose, but I assume you too. I hesitate to give advice in something I'm not sure and I can't try, but maybe use the codes
in the picture I linked above and see if that works better ?
And the output for acute and grave:
KeyRelease event, serial 38, synthetic NO, window 0x3c00001,
root 0x3af, subw 0x0, time 851361, (479,545), root:(485,617),
state 0x0, keycode 49 (keysym 0x60, grave), same_screen YES,
XLookupString gives 1 bytes: (60) "`"
XFilterEvent returns: False

KeyPress event, serial 38, synthetic NO, window 0x3c00001,
root 0x3af, subw 0x0, time 851897, (479,545), root:(485,617),
state 0x0, keycode 203 (keysym 0xb4, acute), same_screen YES,
XLookupString gives 2 bytes: (c2 b4) "´"
XmbLookupString gives 2 bytes: (c2 b4) "´"
XFilterEvent returns: False

So you are telling instead acute and grave it should say dead_acute and dead_grave? And this can be replaced directly in .Xmodmap?
Yes, I think so. In theory if it was dead_acute an dead_grave it would work to give a á or à when you press the b or m key ( at the same time than Mode_switch, which for me is AtrGr, but I don't know what's in a Pyra, maybe the bottom right key ?)
and after realeasing those keys you press the a key. Because composing dead_acute +a => á should already be in a configuration file you're using in somethign like /usr/share/X11/locale/iso8859-1/Compose which depends on your locale setting.


I tried xev in an USB keyboard (I don't have a Pyra) and when pressing the diacritic keys it gave me dead_acute and dead_grave, yes :
KeyRelease event, serial 38, synthetic NO, window 0x5a00001,
root 0x389, subw 0x0, time 39238615, (58,111), root:(63,254),
state 0x0, keycode 48 (keysym 0xfe51, dead_acute), same_screen YES,
XLookupString gives 2 bytes: (c2 b4) "´"
XFilterEvent returns: False

KeyRelease event, serial 38, synthetic NO, window 0x5a00001,
root 0x389, subw 0x0, time 39245086, (58,111), root:(63,254),
state 0x0, keycode 34 (keysym 0xfe50, dead_grave), same_screen YES,
XLookupString gives 1 bytes: (60) "`"
XFilterEvent returns: False
Note that my keyboard has standalone diacritic keys, so I don't have to press AltGr. If you want something similar you should sacrifice some Pyra key and then write dead_key in the first position (after =) instead of third, because the expression is
keycode <number> = <keysym generated when pressed alone> <keysym generated when pressed with Shift presed> <keysym generated with AltGr pressed> <keysym generated with Shift+AltGr pressed>
 
KeyRelease event, serial 38, synthetic NO, window 0x5a00001,
root 0x389, subw 0x0, time 45856016, (154,143), root:(159,286),
state 0x1, keycode 38 (keysym 0x41, A), same_screen YES,
XLookupString gives 1 bytes: (41) "A"
XFilterEvent returns: False

keycode 38 (decimal) is keysim 0x41 (hex) which is 65 decimal which is ASCII for A

keysyms are iso-8859-1 for me when it makes sense, and other values where they aren't ASCII characters.

But keycodes is what the keyboard controller sends at keypress and I though those were the ones written here (in parenthesis) but I can't test that.
 
Yes you're right, it revels keycodes and well as keysyms and the keysyms on my keyboard are the hex ascii code for the upper case example of the character. FWIW the keycode of my A key is also 38 on my Eeepc901,
 
OK, then if the keymat is like FBNil says, but the keycodes are still like this (I don't know)
Then maybe try this xmodmap file:
Code:
!             usr11  USR1   usr2           USR2
keycode 119 = ntilde Ntilde periodcentered dead_diaeresis

keycode 49 = n N dead_grave dead_circumflex
keycode 50 = m M dead_acute dead_diaeresis

keycode 2 = 1 exclam F1 exclamdown
keycode 30 = a A question questiondown

keycode 23 = i I dead_circumflex dead_diaeresis

If it doesn't work just use xev to see the keycode and replace the number for the right one.
And of course there are other alternatives. I'd have to try things out.
Also I may have broken shift-F1 if that's useful for something ?
 
Last edited:
Assuming xev is correct and USR is keycode 127 I added this line.

keycode 127 = ñ Ñ bar Ñ
I'm using bar as an example because I don't know how the symbol "·" .

But I get this error.

asimov@asimov-pyra:~$ xmodmap .Xmodmap
xmodmap: .Xmodmap:54: bad keysym name 'ñ' in keysym list
xmodmap: .Xmodmap:54: bad keysym name 'Ñ' in keysym list
xmodmap: .Xmodmap:54: bad keysym name 'Ñ' in keysym list
xmodmap: 3 errors encountered, aborting.
asimov@asimov-pyra:~$
After that I deleted the line and changed the acute and grave lines this way.

keycode 57 = n N dead_grave N
keycode 58 = m M dead_acute M
It has no effect. After running xmodmap ./Xmodmap it does not behave as a dead key.

This code block might help too ;)
I don't understand what I see here. I just heard the word funkey monkey a thousand times in the forums but I totally ignore its purpose.

Is the layout hardcoded in this funkey monkey and can only be changed at compilation time?
 
Assuming xev is correct and USR is keycode 127 I added this line.
I'm not sure ñ or Ñ is accepted there. Your line should be
keycode 127 = ntilde Ntilde bar Ntilde

I'm using bar as an example because I don't know how the symbol "·" .
try periodcentered
But I get this error.
the keysims are not defined, try the ones in my previous post.

After that I deleted the line and changed the acute and grave lines this way.


It has no effect. After running xmodmap ./Xmodmap it does not behave as a dead key.
Ok. If I understand you right, what you did is press the keys in xev, see that they gave keycode 57 and 58.
Then you wrote that in the file, ran xmodmap
and then you pressed the key at the same time than the rightmost bottom key, and after releasing them you pressed a vowel and it appered without any diacritic.
Well, I don't know what's happening then.
I don't understand what I see here. I just heard the word funkey monkey a thousand times in the forums but I totally ignore its purpose.
It's a program that intercepts key pressed to launch different behaviours. Maybe that's why the mappings don't work, as @sebt suggested.
Is the layout hardcoded in this funkey monkey and can only be changed at compilation time?
Dunno. I thought no, but maybe.
 
Back
Top