When I set up xrdp on Raspbian Jessie a while ago, the keyboard layout appeared to be wrong - commonly used keys seemed to be returning US keycodes rather than UK ones. I found this post very helpful in resolving the problem, but it didn't quite fit the bill when I tried to do the same with a Raspbian Stretch instance recently. Here's what I did on Raspbian Stretch to set up xrdp to provide the correct keycodes.

First, I checked the keboard layout was as expected:

$ cat /etc/default/keyboard | grep LAYOUT
XKBLAYOUT="gb"

Then, I generated a keyboard mapping file using xrdp-genkeymap:

$ xrdp-genkeymap km-00000809.ini

This filename follows the current filename convention (under Jessie, it was km-0809.ini). I then copied this file into the xrdp configuration files directory:

$ sudo cp km-00000809.ini /etc/xrdp

The next step was to edit the file /etc/xrdp/xrdp_keyboard.ini, which appears to be new in Raspbian Stretch. Here are the lines I added, in an excerpt from the file:

[default_rdp_layouts]
rdp_layout_us=0x00000409
rdp_layout_de=0x00000407
< ... lines omitted ... >
rdp_layout_br=0x00000416
rdp_layout_pl=0x00000415
rdp_layout_gb=0x00000809

; <rdp layout name> = <X11 keyboard layout value>
[default_layouts_map]
rdp_layout_us=us
rdp_layout_de=de
< ... lines omitted ... >
rdp_layout_br=br(abnt2)
rdp_layout_pl=pl
rdp_layout_gb=gb

In each case, I added the rdp_layout_gb= lines. The final step was to restart the xrdp service:

$ sudo service xrdp restart

On reconnecting, I found that the keycodes were as they should have been, and I had access to the £@'~#\| keys again in their expected places on the keyboard.

1

View comments

When I set up xrdp on Raspbian Jessie a while ago, the keyboard layout appeared to be wrong - commonly used keys seemed to be returning US keycodes rather than UK ones. I found this post very helpful in resolving the problem, but it didn't quite fit the bill when I tried to do the same with a Raspbian Stretch instance recently. Here's what I did on Raspbian Stretch to set up xrdp to provide the correct keycodes.

First, I checked the keboard layout was as expected:

$ cat /etc/default/keyboard | grep LAYOUT XKBLAYOUT="gb" Then, I generated a keyboard mapping file using xrdp-genkeymap:

$ xrdp-genkeymap km-00000809.ini This filename follows the current filename convention (under Jessie, it was km-0809.ini).
1

The implementation of PEP 391 (Dictionary-Based Configuration for Logging) provides, under the hood, the basis for a flexible, general-purpose configuration mechanism. The class which performs the logging configuration work is DictConfigurator, and it's based on another class, BaseConfigurator.

Last year, Mark Hammond proposed PEP 397 (Python launcher for Windows), to bring some much needed functionality for Python on Windows. Historically, Python on Windows does not add itself to the system path; this needs to be done manually by users as a separate step. This may change in the future, but it remains the case for Python versions that are already released.

With the acceptance of PEP 414 (Explicit Unicode Literal for Python 3.3), string literals with u prefixes will be permitted syntax in Python 3.3, though they cause a SyntaxError in Python 3.2 (and earlier 3.x versions). The motivation behind the PEP is to make it easier to port any 2.x project which has a lot of Unicode literals to 3.3 using a single codebase strategy. That’s a strategy which avoids the need to repeatedly run 2to3 on the code, either during development or at installation time.

The subprocess module provides some very useful functionality for working with external programs from Python applications, but is often complained about as being harder to use than it needs to be. See, for example, Kenneth Reitz’s Envoy project, which aims to provide an ease-of-use wrapper over subprocess.
2

Eric Holscher, one of the creators of Read The Docs, recently posted about the importance of a documentation culture in Open Source development, and about things that could be done to encourage this. He makes some good points, and Read The Docs is a very nice looking showcase for documentation.
5
About
About
Occasional posts about Python programming.
Blog Archive
Loading
All content on this blog is Copyright © 2012-2016 Vinay Sajip. Dynamic Views theme. Powered by Blogger. Report Abuse.