On Sat, Jun 18, 2016 at 4:28 PM, Joao Alexandre
<[email protected]> wrote:
> Hi Mike,
>
> Sorry, I've sent a message without being finished.
>
> I've always been a polite guy, but my 52 years old is driving me impatient,
> so I'm really sorry for my precipitated "bump myself".
>
> First things first, thank you Mike for this detailed, time consuming and
> enlightened reply.
>

No problem!

> Indeed yesterday, I've made a git clone of both Guacamole server and client,
> as I've found the files you've mentioned at "src/protocols/rdp/keymaps".
> I've looked at all of them, made a new one based on the French or Italian
> files, I really don't recall, and altered a Makefile so that the
> "pt_pt_qwerty.keymap" would get compiled. After I tried to test it but then
> I've realized that the web client interface didn't have the option to choose
> my new keyboard, and I could not find out to do it.

Ah, OK.

> Next, I've copied my new Portuguese keymap file over the failsafe.keymap,
> that I thought it was the unicode option in the web interface. I tried these
> combination but I had several mismatch keys. I also search in Google for
> keyboard scan codes, but I could find any information useful, at least to my
> knowledge, so I got frustrated. The Portuguese keyboard has more keys than
> the English one, and at the end of the day I've quit.
>

Figuring out the proper scancodes for keys which are missing from the
English keyboard will be difficult, but not impossible. They must
exist if such keyboards work with RDP at all, so it's just a matter of
time.

> Today after reading your post, I've decided to give it another try, I still
> have doubts.
>
> Forme the Portuguese keymap file should look like this:
>
> parent  "base"
> name    "pt-pt-qwerty"
> freerdp "KBD_PORTUGUSE"
>
> #
> # Basic keys
> #
>
> map -altgr -shift 0x29 0x02..0x0D      ~ "\1234567890'«"
> map -altgr -shift      0x10..0x1B      ~ "qwertyuiop+'"
> map -altgr -shift      0x1E..0x28 0x2B ~ "asdfghjklçº~"

Looks good so far, though "KBD_PORTUGUSE" should be "KBD_PORTUGUESE".

> map -altgr -shift 0x56 0x2C..0x35      ~ "<zxcvbnm,.-"
> (the last character of the second row is a dead key, the accent character in
> "a" letter like á)
>

Dead keys may be a problem. We've had issues supporting these in the
past, as it varies widely by browser and OS how the resulting key
events are exposed to JavaScript (if at all).

I'd be interested to hear what you see when you type "á" using dead
keys while on our JavaScript key event test page:

http://guacamole.incubator.apache.org/pub/tests/key-event-test.html

As well as what happens on the Guacamole key event test page:

http://guacamole.incubator.apache.org/pub/tests/guac/keyboard-test.html

> map -altgr +shift 0x29 0x02..0x0D      ~ "|!"#$%&/()=?»"
> map -altgr +shift      0x10..0x1B      ~ "QWERTYUIOP*`"
> map -altgr +shift      0x1E..0x28 0x2B ~ "ASDFGHJKLçª^"
> map -altgr +shift 0x56 0x2C..0x35      ~ ">ZXCVBNM;:_"
>
> #
> # Keys requiring AltGr
> #
>
> map +altgr -shift 0x12 ~ "€"
> map +altgr -shift 0x09 ~ "["
> map +altgr -shift 0x0A ~ "]"
> map +altgr -shift 0x03 ~ "@"
> map +altgr -shift 0x04 ~ "£"
> map +altgr -shift 0x05 ~ "§"
> map +altgr -shift 0x08 ~ "{"
> map +altgr -shift 0x0B ~ "}"
> map +altgr -shift 0x1A ~ "¨"
>
> Those this looks OK to you?
>

In general, yes, but I don't have a Portuguese keyboard to compare
against. If these mappings seem to work for you thus far (with the
exception of dead keys), then I'd say you're on the right track.

> Yesterday, I've tried a similar setup on failsafe.keymap supposing it was
> the unicode option in the web client, but some keys didn't work like 0x29 \
> between others.
>

The "failsafe.keymap" is a barebones keymap which defines only the
keys common to most layouts which are not available via Unicode. The
keymap system built into Guacamole's RDP support will default to
sending Unicode events (which are distinct from key events, but
supported by Windows and RDP) if there are no combinations of
scancodes which can produce the desired effect. By not defining
virtually any keys, the failsafe keymap forces use of Unicode events
for everything.

> Last questions:
>
> - does failsafe.keymap correspond to unicode?

Yes, in that it forces the Guacamole RDP keymap system to fallback to
Unicode events. This can be problematic in some cases, however,
especially if the RDP server does not implement Unicode events (like
XRDP and some virtualization software).

> - Is it easy to add a new keyboard option in the web client?
>

Yes. All available options for the admin interface are defined using
JSON within guacamole-ext [1]. You would need to add your option to
that JSON definition.

Once that's done, you'll need to add a translation string at least for
English so that the interface knows what to display when rendering the
option [2].

> Once more, thank you.
>

Sure thing. Please give it another shot, and definitely come back if
you have any further questions.

It would be wonderful to get some more keymaps added to the RDP
support, and hopefully use this to drive development which gets dead
keys working correctly ... if that is possible at all.

Thanks,

- Mike

[1] 
https://github.com/apache/incubator-guacamole-client/blob/e8232315ce06fbb480ebf5785ea866577bd3e994/guacamole-ext/src/main/resources/org/apache/guacamole/protocols/rdp.json#L63-L76
[2] 
https://github.com/apache/incubator-guacamole-client/blob/e8232315ce06fbb480ebf5785ea866577bd3e994/guacamole/src/main/webapp/translations/en.json#L337-L344

Reply via email to