nanogui: Thread: keyboard layout


[<<] [<] Page 1 of 1 [>] [>>]
Subject: keyboard layout
From: Takács ####@####.####
Date: 7 Sep 2007 13:44:45 +0100
Message-Id: <46E147DD.4060200@infracont.hu>

Hi,

I am using Nano-X on an ARM board. I am also using nxlib and fltk. I 
have the following problem:
When I change the keymap with loadkeymap, the grabdemo application shows 
that the keycode gets different for the same key. It is right. But when 
I run nxlib and fltk, it seems if it had switced back to the original 
keyboard layout. (The keycode for the a key is always the same 
regardless of running lodkeys previously or not.)
Any idea is welcome! Thanks!

Áron Takács
Subject: Re: [nanogui] keyboard layout
From: "Greg Haerr" ####@####.####
Date: 7 Sep 2007 16:12:56 +0100
Message-Id: <053d01c7f161$87fe4c20$6401a8c0@winXP>

: But when 
: I run nxlib and fltk, it seems if it had switced back to the original 
: keyboard layout. (The keycode for the a key is always the same 
: regardless of running lodkeys previously or not.)

X11, and thus NXlib, uses the scancode from the kernel, not
the translated key from the kernel keymap.  This code is in
nxlib/NextEvent.c:

event->xkey.keycode = pev->scancode; 



X11 programs then use XLookupKeysym() get the
translated value.  There is a table in nxlib/StrKeysym.c
which you will have to replace and load from the kernel,
which will take a bit of work since it handles nano-X
MWKEY_* function/special key processing.  I suggest
dyamically loading this table from the kernel, and replacing
all keys less than MWKEY_FIRST.

If you get this changed, please send a patch.

Regards,

Greg
Subject: Re: [nanogui] keyboard layout
From: Takács ####@####.####
Date: 12 Sep 2007 14:45:46 +0100
Message-Id: <46E7EDAB.9050803@infracont.hu>

Hi, Greg,

Attached you can find my StrKeysym.c file. The file stub.c is also 
modified: row 102 (XRefreshKeyboardMapping...) is not needed here.
Now it is working for me with fltk-1.1.x - except AltGr.
I have implemented XRefreshKeyboardMapping() that loads the kernel 
keymap. (This is not an X-compatible implementation of the function: It 
doesn't care of the pointer given in the parameter.)
Unless you call XRefreshKeyboardMapping() first, nxlib will use the 
original mapping.
I've tried to implement AltGr similarly to Shift but it didn't work, I 
don't know why? If somebody could help me in this...
Maybe the solution is not correct, but it works - at least here, for me 
:-) I hope that others can use it also.

Regards

Áron Takács

p.s: If somebody has patches for fltk2, please let me know...


> Aron -
> 
> First, lets discuss this on the list.
> 
> Look at the file drivers/kbd_ttyscan.c to see how
> Microwindows reads in the keymap table, and you
> should be able to make it work from there.
> 
> I don't have any new functionality patches for nxlib.  Ask
> the list to see if we can get them, I'll add them to
> CVS.  Otherwise, you can add the stub functions, returning 0
> and start the port from there.  In most cases the functions
> aren't needed.
> 
> Regards,
> 
> Greg
> 
> 
> 
> thank you for your answer! Now I understand the problem (more or
> less...), but I need some help resolving it.
> The question is how can I read the keymap table from the kernel?
> 
> I'd also like to have fltk-utf8 running, but some functions (XOpenIM,
> etc...) are not implemented in nxlib yet. I've read int the mailing
> lists that someone has got fltk2 working. Do you have maybe any patches
> for nxlib? Or could you please help me implement these functions? How
> much work is it?
> Thanks!
> 
> Áron
> 

[Content type text/x-c not shown. Download]
[<<] [<] Page 1 of 1 [>] [>>]


Powered by ezmlm-browse 0.20.