Re: XKB Patch

Ilya Konstantinov <[email protected]>
Newsgroups gmane.network.rdesktop.devel
Message-ID <[email protected]>
On Fri, May 15, 2009 at 5:34 PM, Peter Åstrand <[email protected]> wrote:

>
> Guys, I don't know why you insist on completely *missing* the one main
>> thing which XKB gives you:reliable (runtime)
>> [ X11 keysym -> hardware key ] mapping
>>
>
> Well, basically I don't know how XKB works or what kind of capabilites it
> has. I'm planning to try to learn it, but digging through the 155 pages XKB
> protocol specification doesn't sound like much fun...


So there, I'm giving you a rundown :)

In any case, I wouldn't start with the spec. The spec is the API reference
when using libXkb. Just to understand the architecture, I'd read Ivan
Pascal's doc:
http://pascal.tsu.ru/en/xkb/internals.html

Instead, you choose to focus on locales, languages, keyboard names and
>> variants and whatnot. Why? There is no need to know whether the keyboard is
>> English or Lithuanian,
>>
>
> Perhaps not for sending a suitable scancode, but one needs to tell the
> remote desktop which keymap to use.


Yes, you're referring to the "secondary keyboard language LCID" in the RDP
init packet.
You can do this through heuristics, e.g. by parsing the _XKB_RULES_NAMES
root window property. (You don't need the XKB API for that.)
Without XKB, you can determine it from the locale.

It's a best-effort guess thing, really. It has nothing to do with keyboard
mapping; it's just about trying to pass a piece of the local user
preferences to the remote machine, to provide a more familiar desktop on the
remote machine.

Simply do this:
>> 1. Read the XKB *keyname* -> X11 keycode (NOT keysym) mapping (dynamically
>> from the server - use the XKB API)
>> 2. Reverse it (make it a keycode->keyname map)
>> 3. Write a mapping (even statically, in code!) which maps XKB *keynames*
>> to AT (RDP) scancodes. This mapping should
>> be used instead of the rdesktop keymap facility.
>>
>
> So basically, you want the rdesktop keymaps to map "XKB keynames to
> scancodes", instead of "keysyms to scancodes"? I guess that's possible. But
> what should rdesktop do with Xservers that doesn't support XKB?


When the XKB extension is not available, we should fall back to the existing
facility (the one which uses rdesktop keymap files).

------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables 
unlimited royalty-free distribution of the report engine 
for externally facing server and web deployment. 
http://p.sf.net/sfu/businessobjects

_______________________________________________
rdesktop-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/rdesktop-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.