maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Maemo 5 / Fremantle (https://talk.maemo.org/forumdisplay.php?f=40)
-   -   Problems with multiple xkb layouts (https://talk.maemo.org/showthread.php?t=94175)

marmistrz 2014-11-16 18:19

Problems with multiple xkb layouts
 
Hi,

I'm playing with my N900 to enable multiple keyboard layouts. I'm using the Russian layout as the second one as it's non-qwerty. I did

Code:

setxkbmap -layout pl,ru
setxkbmap -option grp:ctrl_shift_toggle

But pressing both keys doesn't do anything.

Interestingly, after issuing
Code:

setxkbmap -layout ru
the letter keys work as if no command were issued, but left arrow outputs "б" and the up arrow - a dot.

And besides - is it possible to add layouts, best in separate files, to be used by xkb on N900? And is there a polytonic Greek layout for N900?

marmistrz 2014-12-14 11:38

Re: Problems with multiple xkb layouts
 
Well, I played once again and noticed that pressing both keys does in fact change the layout.

The problem is that even if I'm using the Russian layout, I'm unable to enter Russian characters. Pressing a gives a, etc. Only the right arrow gives the Russian "b". How can I enter Russian characters when using the Russian xkb layout? Why does the layout doesn't allow me to enter cyrillic characters?

marmistrz 2014-12-27 15:55

Re: Problems with multiple xkb layouts
 
Bump! (10 chars)

Mentalist Traceur 2014-12-27 17:55

Re: Problems with multiple xkb layouts
 
Quote:

Originally Posted by marmistrz (Post 1447386)
Hi,

I'm playing with my N900 to enable multiple keyboard layouts. I'm using the Russian layout as the second one as it's non-qwerty. I did

Code:

setxkbmap -layout pl,ru
setxkbmap -option grp:ctrl_shift_toggle

But pressing both keys doesn't do anything.

I haven't tried that route in a long time: I settled on mapping a key to ISO_Next_Group (and then eventually another key to ISO_Prev_Group). For example, in the /usr/share/X11/xkb/symbols/nokia_vndr/rx-51 file, my mapping for left shift looks like this:

Code:

key <LFSH> {
    type[Group1]= "FOUR_LEVEL",
    symbols[Group1] = [ Shift_L, Shift_L, ISO_Next_Group, ISO_Prev_Group]
};

(Note that the fourth level is rather useless because there's no way I have found to get the shift key to be pressed while already shifted and fn-ed.)

..and my mapping for my control key looks like this:

Code:

key <LCTL> {
    type[Group1]= "FOUR_LEVEL",
    symbols[Group1] = [ Control_L, Control_L, ISO_Prev_Group, ISO_First_Group]
};

(Again, I mostly don't use the fourth level. Note that I don't even bother having a way to get to the virtual special-symbol keyboard, since that breaks when you have multiple layouts the way I do anyway.)

Quote:

Originally Posted by marmistrz (Post 1447386)
Interestingly, after issuing
Code:

setxkbmap -layout ru
s
the letter keys work as if no command were issued, but left arrow outputs "б" and the up arrow - a dot.

-and-
Quote:

Originally Posted by marmistrz (Post 1452158)
Well, I played once again and noticed that pressing both keys does in fact change the layout.

The problem is that even if I'm using the Russian layout, I'm unable to enter Russian characters. Pressing a gives a, etc. Only the right arrow gives the Russian "b". How can I enter Russian characters when using the Russian xkb layout? Why does the layout doesn't allow me to enter cyrillic characters?

I'm not really sure off the top of my head what situation you got yourself into as far as the layouts go, which could explain this, but as a reminder: The stock Russian layout is coded as an 8-level layout: it's got this wierd coupling with the Ctrl+Space layout switch that Nokia coded into Hildon, where the first four levels are basically an English layout, and the upper four are the Russian one. Might be relevant? For my Russian layout, I completely stripped out the bottom four levels, made it just a four-level layout of just cyrillic characters, and that works fine for me.

Quote:

Originally Posted by marmistrz (Post 1447386)
And besides - is it possible to add layouts, best in separate files, to be used by xkb on N900?

Yes. I don't have a ready-made example for you, but it's something I've been meaning to do on my N900s (because I've gotten to the point where I'm just adding new layouts to the rx-51 file, which is just clumsy and prone to getting clobbered during updates). I'll come back to this and let you know when I've had a chance to get around to doing this on my own.

In the meantime, here's something you may find useful. I set up my layouts to load on boot by changing the /app/osso/inputmethod/int_kb_layout key in gconf to "us,nokia_vndr/rx-51(ru),nokia_vndr/rx-51(oth)"

Note a few things:
1. the first layout is also inside the nokia_vndr/rx-51 file. For some reason that I don't currently remember the explanation to (if I ever found that explanation at all, but I think I did or at least started to and just forgot it), the first layout is assumed to be in that file.
2. All other layouts are specified, seemingly, as relative paths to the layout file from the symbols directory, with the layout names specified in parentheses. So in the above example, I am adding the us, ru, and oth layouts from my rx-51 file.
3. The 'oth' layout is one I completely added from scratch, mostly has a bunch of other keys I wanted access to but which didn't neatly go into the other two layouts. The 'ru' layout is heavily modded, to a normal four-level layout instead of the stock 8-level coupled-to-Hildon's-Ctrl+Space-combo one, as aforementioned.

So you should be able to have other layouts pulled from any other files. I personally intend on making a personal folder inside the symbols folder (or some sub-folder) and putting my layout files inside that.

Quote:

Originally Posted by marmistrz (Post 1447386)
And is there a polytonic Greek layout for N900?

Not that I am aware of. I started making a layout with a bunch of Greek symbols, but I am not fluent in Greek nor familiar with the standard keyboard layout(s?) for Greek keyboards. I just wanted the characters for the usecase of writing out mathematical equations.

The XKB symbol names are, for example: "Greek_theta" (lowercase) / "Greek_THETA" (uppercase). So you can use that information as a starting point to make your own.

P.S. I find it infinitely frustrating just how much of an acrane fractal of unexplained-ness the xkb system is.

marmistrz 2015-05-10 16:21

Re: Problems with multiple xkb layouts
 
Mentalist Traceur: Have you found a way to add kbd layouts as separate files?

ekze 2015-05-10 23:34

Re: Problems with multiple xkb layouts
 
N900's default for changing keyboard layout is ctrl+space. But, you cannot enter non-latin characters when your hardware layout is set to United States for example for some reason: https://bugs.maemo.org/show_bug.cgi?id=2501 . You need to change your hardware layout to Russian and add English (US) inside as a second layout and switch between them using ctrl+tab. It is possible to do that using default settings GUI.
The problem is that Russian N900 hardware keyboard layout is pretty weird, as it doesn't have up and down buttons (you have to use fn+left and fn+right instead): https://upload.wikimedia.org/wikiped...kia_N900-1.jpg
The solution for this is to have multiple hardware keyboard layouts and switch between them, instead of just changing layout within one hardware layout (English on Russian hardware layout is acceptable, but no up-down cursor keys makes it annoying), and you cannot at all enter cyrillic in United States hardware layout.

Here you can find an applet that adds itself into status bar allowing you to change hardware keyboard layout without going into settings every time: http://talk.maemo.org/showthread.php?t=38752

Hope this helps!

And to answer your last question in the first post, are you aware of this package: http://maemo.org/downloads/product/Maemo5/ukeyboard/ it seems to add more layouts to n900.

marmistrz 2015-05-14 07:21

Re: Problems with multiple xkb layouts
 
Thanks! I'm at most interested in adding the layouts in separate files. I'm just about to add a phonetic Russian layout (а in place of a, в in place of w, б in place of b, г in place of g, etc.) and a sensible Greek layout. And I'd rather had it backed up or, even better, packaged.

Would it work (I'd rather not reflash ;) ) if I created the file /usr/share/X11/xkb/symbols/nokia_vndr/my-layouts with the content

Code:

partial alphanumeric_keys
xkb_symbols "my-layout" {
    name[Group1] = "Russian phonetic";
   
// And here define the keyboard row by row
//1st row
key <AD01>    { [    Cyrillic_ya,        Cyrillic_YA,        1,        1        ] };
// and so on
};

Or is the folder nokia_vndr limited to the three files only?


All times are GMT. The time now is 17:55.

vBulletin® Version 3.8.8