Keyboard mapping setup

71 views
Skip to first unread message

HaPe

unread,
Jul 29, 2010, 8:49:57 AM7/29/10
to jOpenRay
Hi all,

I'm running Sunray1 with RDP to Win2003 server.
I've attached the original Sun US keyboard but the keyboard mapping is
wrong,
e.g. when I press "m" it gets",".
I've seen no info about the used keyboard mapping, nor the option to
configure it.
(only the directory "jOpenRay\Keymaps" - but no clue what toset/change
there)

Regards HaPe

B.t.w. Kudos to Guillaume: Compared to the Solaris-SRSS-Beast this is
leightweigt, simple to setup and use!

Guillaume Maillard

unread,
Jul 30, 2010, 5:30:09 AM7/30/10
to jope...@googlegroups.com
Hi,

You are pointing a dirty little secret of computer manufacturers... :(

In a perfect world, a keyboard should send a unique code (unicode) related to the the caracter you press or release.
In US, manufacturers really don't care about the other countries, that's why in the rest of the world we are "playing" with keyboards mapping, file encoding, etc...

In order to minimize the issues, the Sun USB keyboard implements HID, which is supposed to
return 'a' when you press the key 'a'. But on my french keyboard, it's not the case... the manufacturer only change the labels on the keyboards, not the mapping...

In order to solve the keymap issue, we convert keys from the keyboard to Java keycode (which are common on every systems).

When using a RDP adapter, jOpenRay converts the Java keycodes to RDP keycodes,
which are converted to the final letter by the keymap defined on your remote windows...
To sum up:
Sun Keyboard -> Hid -> Java -> RDP -> Windows keymap -> Screen

Because, I have no US keyboard, you will have to modify the "Hid to Java" mapping
defined in org.jopenray.util.HID

public static int hidToKeyCode(int hid) {
        int r = 0;
        switch (hid) {
        case 4:
            r = KeyEvent.VK_Q;
            break;

will I think become: case 4:
            r = KeyEvent.VK_A;

The best way to test is to start with a SSH session because have no Java -> RDP -> Windows keymap conversion.

As soon as you have a full working US mapping, I will add a keyboard selector on the UI.

Regards,
Guillaume



2010/7/29 HaPe <chapp...@gmx.de>

HaPe

unread,
Jul 30, 2010, 8:06:07 AM7/30/10
to jOpenRay
Hi Guillaume,

OK I think I can do the keyboard mapping.
But I'm not too familiar with Eclipse et.al.
I managed to setup the eclipse project and get it running,
in which form do you expect me to provide the mapping?
(most archaic way: just send you the changed ASCII ;-)

But that'll have to wait, since I'm leaving for vacation this
weekend :-)

Regards HaPe


On 30 Jul., 11:30, Guillaume Maillard <guillaume.maill...@gmail.com>
wrote:
> 2010/7/29 HaPe <chappi-...@gmx.de>

Guillaume Maillard

unread,
Jul 30, 2010, 10:17:09 AM7/30/10
to jope...@googlegroups.com
Hi,

All we need is the line you changed, you can send them as a diff file,
Eclipse has a built in function to create it, right click Team/Create Patch.

Happy vacations!

Regards,
Guillaume

2010/7/30 HaPe <chapp...@gmx.de>
Reply all
Reply to author
Forward
0 new messages