guacamole-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joao Alexandre <>
Subject Re: Portuguese European (pt-PT) RDP keyboard layout.
Date Sat, 18 Jun 2016 23:28:46 GMT
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.

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.
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.

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"

# Basic keys

map -altgr -shift 0x29 0x02..0x0D      ~ "\1234567890'«"
map -altgr -shift      0x10..0x1B      ~ "qwertyuiop+'"
map -altgr -shift      0x1E..0x28 0x2B ~ "asdfghjklçº~"
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 á)

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?

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.

Last questions:

- does failsafe.keymap correspond to unicode?
- Is it easy to add a new keyboard option in the web client?

Once more, thank you.

Kind regards,

João Alexandre

On Sat, Jun 18, 2016 at 5:45 AM, Mike Jumper <>

> On Fri, Jun 17, 2016 at 4:49 AM, Joao Alexandre <>
> wrote:
>> Hi All,
>> I do understand that this mailing list isn't an answering machine, but
>> could anyone give me some help, tip, please?
> Hi João,
> Please be patient [1]. Sometimes we respond quickly, other times slowly.
> We always try to respond eventually, but we are all volunteers here.
> There's no harm in giving your email thread a friendly bump, but please
> keep this in mind.
>> On Wed, Jun 15, 2016 at 5:42 PM, Joao Alexandre <
>> > wrote:
>>> Hi All,
>>> I would like very much to have a Portuguese European (pt-PT, Portugal)
>>> RDP keyboard layout in Guacamole.
>>> I'm not a programmer, but I'm available to help anyway to accomplish
>>> this.
> Great!
> This actually shouldn't be too tricky. Adding a new keyboard layout does
> not require any real programming, but you would need to create a keyboard
> mapping file. There are a few examples of this in the source [2][3], so the
> first thing I would recommend is that you take a brief look at those files
> and see what you think.
> You need to understand at least conceptually the purpose of these
> mappings. Guacamole uses "keysyms" to represent pressed/released keys.
> These are conveniently well-defined by X11 and are quite thorough; they
> represent the *identity* of a key, as well as the implied behavior. If you
> attempt to type "a", Guacamole will send the keysym representing the
> lowercase letter "a". Protocols like VNC and SSH are very happy with this,
> as they also only care about the identity of the key or character, not the
> hardware implementation of that key.
> RDP is a different animal. It uses scancodes to represent keys. Keyboard
> scancodes do not represent the identity of the key - they represent the
> *location* of the key. If you press "a" while using an RDP client, the
> client sends a key event to the server which more-or-less translates to
> "the user pressed the second key in the second row". Clearly, determining
> what that actually means depends on the keyboard layout, which brings us to
> Guacamole's RDP keymap system:
> Guacamole's RDP support contains a system which translates received
> keysyms to a corresponding sequence of scancodes, where that sequence is
> whatever is required to duplicate the function of the pressed key on the
> RDP server. Often, this is a simple one-to-one mapping of keysym to
> scancode, but it can get much more complicated. Take, for example, the "@"
> character:
> On a US keyboard, this is typed by pressing Shift+2. On a German keyboard,
> this is typed by pressing AltGr+Q. Thus, if you're using a US keyboard
> while connected to an RDP server that expects a German keyboard, Guacamole
> has to perform some shuffling when following when you type "@":
> 1) The Shift key is currently held down, but the remote keyboard cannot
> type "@" with Shift. Release Shift.
> 2) The AltGr key is not held down, but the remote keyboard requires this
> for "@". Press AltGr.
> 3) The "@" key maps to scancode 0x10 - send that.
> 4) The AltGr key was not originally held down. Release AltGr to restore
> state.
> 5) The Shift key was originally held down. Press Shift to restore state.
> This behavior is automatic thanks to the keymap files mentioned above. In
> this case, it's due to the following simple line in the German keyboard
> mapping file:
> map +altgr -shift 0x10 ~ "@"
> which essentially means "to type '@', use scancode 0x10, and ensure that
> AltGr is pressed and Shift is released". The keymap file syntax is more
> flexible than this, though, and allows you to define entire swaths of keys
> in a way that is visually easy to verify:
> map -altgr -shift      0x02..0x0C      ~ "1234567890ß"
> map -altgr -shift      0x10..0x1B      ~ "qwertzuiopü+"
> map -altgr -shift      0x1E..0x28 0x2B ~ "asdfghjklöä#"
> map -altgr -shift 0x56 0x2C..0x35      ~ "<yxcvbnm,.-"
> The whole concept is to define the requirements and behavior of the
> keyboard that the RDP server is using, such that incoming keysyms from the
> Guacamole client can be correctly and automatically translated into
> sequences of scancodes based on the meanings of those keys from both the
> client's and server's perspectives.
> ... make sense?
> Let me know if you have any questions on this.
> Thanks,
> - Mike
> [1]
> [2]
> [3]

View raw message