[Spice-devel] spice-html5 keyboard layout fix proposal

Eric Grammatico eric at grammatico.me
Thu Mar 17 16:50:58 UTC 2016


Gentle(wo)men,

I have spent time to fix the keyboard layout in spice-html5. I went to the conclusion the keyboard layout cannot be configured on client (html5) side as Xorg receives key code it interpretes. What ever the key face the user has typed (A or Q) Xorg will map to the character depending of its configuration.

The drawback was on my setup Xspice ignores my keyboard config and the only way I found to force my keyboard layout was to launch setxkbmap from .xinitrc.

I kept the same structure around utils.js, atKeynames.js and inputs.js. In atKeynames I mapped the Xorg symbols defined in /usr/share/X11/xkb/symbols. This way, all the non changing keys (like ESCAPE) through the different layouts are well defined and the others are map to symbols like AD01. In some how it's kept readable...

Then I have updated utils.js and inputs.js in consequence.

Please find attached my diff file as a proposal. Tests and comments are very wellcome.

Thanks and regards,

-
_/) Eric Grammatico.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20160317/17317183/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: spice-html5.diff
Type: application/octet-stream
Size: 38139 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20160317/17317183/attachment-0001.obj>


More information about the Spice-devel mailing list