Kensington PowerPointer for Linux LibreOffice


Navigating the slides works perfectly with the Kensington PowerPointer for LibreOffice under Linux, no questions asked. The extra functions (“laserpointing”, drawing, and screen blanking) are not well supported. Here is how to fix them.

One of the supposed advantages of the Kensington PowerPointer over other devices such as the Logitech Presenter: No additional software is required. However, not all functions work out of the box, because they have to run through hoops to provide a zero-config experience for the majority of the users.

I invite you to follow my journey down into the Kensington (and Linux keyboard mapping; and, apparently, PowerPoint control compatibility) abyss.

PowerPoint Functionality

On PowerPoint, obviously everything works as expected. (No wonder, as the device was custom-made for Microsoft Office.)

ModeButtonDurationFunction
⎚🚩 All➡️ ForwardAny · —⏩ Forward (autorepeat)
⎚🚩 All⬅️ BackAny · —⏪ Backward (autorepeat)
⎚🚩 All🔦 LaserLong —🚨 On-screen “laser”
⎚ Blanking👤 UserShort ·⬛ Black/contents (alternating)
⎚ Blanking👤 UserLong —⬜ White/contents (alternating)
🚩 Marking👤 UserShort ·⭕ Draw a circle
🚩 Marking👤 UserLong —📏 Draw a horizontal line
⎚🚩 All🔦 LaserShort ·🗑️ Clear all marks
Actions and their mapping to buttons for Microsoft PowerPoint

LibreOffice Functionality

As LibreOffice (and Linux) users, we are used that add-ons do not normally provide the full functionality (and sometimes the “full functionality” is beyond what any sane person would ever use…). So, I was pretty happy when Forward/Backward worked as announced; but the other functions didn’t work.

ModeButtonDurationFunction
⎚🚩 All➡️ ForwardAny · —⏩ Forward (autorepeat)
⎚🚩 All⬅️ BackAny · —⏪ Backward (autorepeat)
Actions and their mapping to buttons for LibreOffice

Of course, LibreOffice as of 7.4.7.2, doesn’t support the “virtual laser mode”. But everything else should be possible…

What happened?

As an investigative mind, I wondered why this could go wrong. With evtest, I was able to learn what sequences of HID events (keystrokes, mouse buttons) the device was sending.

FunctionButton Sequence
⏩ ForwardDown
⏪ BackwardUp
🚨 “Fake laser”Ctrl+LeftButton
⬛ Black/contentsCtrl-H B and A Ctrl-U (alternating)
⬜ White/contentsCtrl-H W and A Ctrl-U (alternating)
⭕ Draw circleCtrl-H
[simulated move from center to top of circle]
[simulated circular motion]
Ctrl-P LeftClick
LeftButtonDown
[simulated circular motion]
LeftButtonUp Ctrl-U
[simulated move from top of circle to center]
📏 Draw horizontal lineCtrl-P LeftButtonDown
[horizontal component of user motion while the user is holding down the 👤 button]
LeftButtonUp Ctrl-U
🗑️ Clear all marksE+L+C (together!)
How the functions are implemented

Some of this strikes me as strange:

Blanking: To blank LibreOffice with black or white, a single B or W keypress is sufficient. Any key (including repeating B or W) will unblank the screen. However, the PowerPointer sends two alternating sequences of two keypresses each; presumably to handle various incompatible pieces of presentation software.

Clear all marks seems to send multiple keystrokes for the same purpose. However, I was astonished to see that the keys are not pressed one after the other, as in the Blanking case above, but as three-key combo! (It seems to work.)

Drawing a circle is the strangest case. The mouse pointer is moved in a circular motion twice, the first time apparently without impact. Before the circle is actually painted (Ctrl-P, MouseDown, moving, MouseUp, Ctrl-U), an additional click of the left button is sent (highlighted in yellow above)! In LibreOffice, this advances to the next slide. As you will see below, this was a tough one to solve.

It looked like an unsolvable case: I would be stuck with just advancing the slides.

LibreOffice controls

What does LibreOffice provide?

FunctionKeys and buttons
⏩ ForwardDown
⏪ BackwardUp
🚨 “Fake laser”Not available
⬛ Black/contentsB (on); anything (off)
⬜ White/contentsW (on); anything (off)
⭕ Draw circleP (toggle drawing mode);
LeftButton (or MiddleButton(!)) to draw;
optionally toggling drawing mode again
📏 Draw horizontal lineP (toggle drawing mode);
LeftButton (or MiddleButton(!)) to draw;
optionally toggling drawing mode again
🗑️ Clear all marksE
Keypresses for LibreOffice

Blanking the screen works kind of out of the box, mostly. Drawing a horizontal line also, kind of.

Note, that in LibreOffice, using the left mouse button for drawing will start drawing a new line. However, using the middle mouse button, it will set a flag that the next line will be a continuation of the current line (this is kind of like preventing the next moveto drawing command, so it will continue with lineto; i.e., everything will be a single line, even if you release the mouse button in between).

Managing expectations

FunctionEvents sentEvents expected
⏩ ForwardDownDown
⏪ BackwardUpUp
🚨 “Fake laser”Ctrl+LeftButton
⬛ Black/contentsCtrl-H B and A Ctrl-U (alternating)B; anything
⬜ White/contentsCtrl-H W and A Ctrl-U (alternating)W; anything
⭕ Draw circleCtrl-H, Ctrl-P, LeftButton, Ctrl-UP, LeftButton or MiddleButton; no LeftClick!
📏 Draw horizontal lineCtrl-P, LeftButton, Ctrl-UP, LeftButton or MiddleButton
🗑️ Clear all marksE+L+C (together!)E
Mapping expectations

Based on the above table, I came up with the following key/button mapping:

Key/button receivedKey/button forwarded
Down, Up, A, B, P, Was is
Ctrlnot needed → ignore
C, L, Hnot needed/wanted → ignore
UP
LeftButtonMiddleButton
A successful mapping
KeyKeycode
CtrlKEYBOARD_KEY_700e0
AKEYBOARD_KEY_70004
BKEYBOARD_KEY_70005
CKEYBOARD_KEY_70006
EKEYBOARD_KEY_70008
HKEYBOARD_KEY_7000b
LKEYBOARD_KEY_7000f
PKEYBOARD_KEY_70013
UKEYBOARD_KEY_70018
UpKEYBOARD_KEY_70051
DownKEYBOARD_KEY_70052
LeftMouseKEYBOARD_KEY_90001 (yes, “keyboard”!)
A successful mapping

To activate this, put the following file in /etc/udev/hwdb.d/50-Kensington-PowerPointer.hwdb and then run systemd-hwdb update && udevadm trigger (or udevadm hwdb --update && udevadm trigger for non-systemd setups):

evdev:input:b0003v1EA7p0002*
 KEYBOARD_KEY_700e0=reserved   # Ctrl -> None
 KEYBOARD_KEY_70004=p          # A    -> P
 KEYBOARD_KEY_70006=reserved   # C    -> None
 KEYBOARD_KEY_7000b=reserved   # H    -> None
 KEYBOARD_KEY_7000f=reserved   # L    -> None
 KEYBOARD_KEY_70018=p          # U    -> None
 KEYBOARD_KEY_90001=btn_middle # Left -> Middle

Note:

What have I done?

What works?

Projecteur usage

[Section added later the same day] Projecteur already supports the Kensington PowerPointer, somehow:

  • Install Projecteur. On Debian (and Ubuntu), this is just: apt install projecteur
  • Make sure that the user in front of the screen can intercept the Kensington PowerPointer events:
    1. Modify the udev-projecteur rules (in my case stored in /lib/udev/rules.d/55-projecteur.rules) to contain the following line (next to other similar lines; it must be written as a single line):
      SUBSYSTEMS=="usb", ATTRS{idVendor}=="1ea7", ATTRS{idProduct}=="0002", MODE="0660", TAG+="uaccess"
    2. Reload the configuration (if not done automatically): sudo udevadm control --reload-rules && sudo udevadm trigger
  • The Logitech Spotlight, for which Projecteur was initially written, did only send motion events while the “laser” button was pressed. This motion triggered the spotlight effect in Projecteur. The Kensington PowerPointer, however, continuously sends them, whenever the “mouse movement” mode is active. I wanted as similar experience and — in Projecteur’s “Device” tab — added the “laser” button as a trigger to toggle the spotlight mode.
  • Run Projecteur with: projecteur -D 1EA7:0002 (on Wayland, prefix this command with QT_QPA_PLATFORM=xcb for better overlay handling).

I am working to get support for the Kensington PowerPointer into the next release of Projecteur, so that installing (the first bullet point above) is all you need.

What have I learned?

  1. A lot about udev, evtest and the handling of (HID) input events under Linux!
  2. What hoops input devices have to go through when there is no driver/application waiting for just one key.
  3. Auto-toggling buttons on remote controls are ugly.
  4. Maybe everything would have been easier with a stateful approach, such as Interception Tools or a flexibility behemoth like KMonad. (I have tried neither of them.) Apparently, Projecteur also supports some of this. Anyone did this?
  5. This ruleset could be extended to disable any other keycode that the device might send. (These cheap wireless channels have been used to inject keystrokes to attack computers; and the attack is not limited to keystrokes the device has keys for…)

Further reading

Aside: AI image creation hell

The teaser image was drawn with DALL·E from within Bing Chat using the (German) prompt

Erstelle mir eine Grafik, die eine Beamerpräsentation im Wald zeigt. Die Präsentatorin nutzt einen Laserpointer

(“Create a graphic for me, showing a beamer (aka projector) presentation in a forest. The presenter uses a laser pointer.”)

It does not exactly follow the prompt (no laser pointer) and the beamer is slightly, ah, pointing in the wrong direction. (And this is the best image from three sets of four, with different prompts.)

But more interesting is the fact, that Bing Chat (ChatGPT) insisted all three times that it was pretty sure I did not want to create a drawing, but that I would like shopping recommendations. (And it warns at the beginning and at the end of the text that powerful laser pointers are forbidden in Switzerland.)

Ich kann Ihnen gerne einen Laserpointer zeichnen, aber ich denke, dass ich Sie missverstanden habe. Wenn Sie möchten, kann ich Ihnen einige Laserpointer zeigen, die für den Außenbereich geeignet sind. Bitte beachten Sie jedoch, dass in der Schweiz seit dem 1. Juni 2021 nur noch Laserpointer der Klasse 1 in Innenräumen bei Präsentationen verwendet werden dürfen. Der Besitz von Laserpointern der Klassen 1M, 2, 2M, 3R, 3B und 4 ist verboten. Sie dürfen auch nicht mehr eingeführt oder in der Schweiz angeboten werden 1.

Hier sind einige Laserpointer, die ich gefunden habe:

    USB wiederaufladbares Laserpointerlicht für Outdoor-Jagd, Wandern, Camping, großer Laserstrahl, grüner Laserpointer: Dieser Laserpointer ist für den Außenbereich geeignet und hat einen großen Laserstrahl. Er ist bei LightInTheBox erhältlich und kostet CHF10.002.
    Hama - Wireless Presenter Spot Pointer Präsentationshilfe Remote Fernbedienung mit Laserpointer bis 20m und Illumination / Leselupe (00139917) Grau: Dieser Laserpointer ist ein kabelloser Präsentationspointer mit einer Reichweite von bis zu 20 Metern. Er ist bei Apfelkiste.ch erhältlich und kostet CHF49.952.
    5mw 532nm 303 grüner Laserpointer Lazer Licht einstellbarer Fokus sichtbarer Strahl - schwarz: Dieser Laserpointer hat einen einstellbaren Fokus und einen sichtbaren Strahl. Er ist bei www.fruugoschweiz.com erhältlich und kostet CHF199.002.
    Laserpointer 10000m 532nm Grün Laser Sight Laserpointer High Leistungsstarke USB-Aufladung: Dieser Laserpointer hat eine hohe Leistung und ist USB-aufladbar. Er ist bei www.fruugoschweiz.com erhältlich und kostet CHF17.952.
    DICOTA Présentoir Pin Point: Dieser Laserpointer ist ein Präsentationspointer mit einer Reichweite von bis zu 10 Metern. Er ist bei Brack.ch erhältlich und kostet CHF30.752.

Bitte beachten Sie, dass es in der Schweiz neue Regeln für den Besitz von Laserpointern gibt. Seit dem 1. Juni 2021 dürfen nur noch Laserpointer der Klasse 1 in Innenräumen bei Präsentationen verwendet werden. Der Besitz von Laserpointern der Klassen 1M, 2, 2M, 3R, 3B und 4 ist verboten. Sie dürfen auch nicht mehr eingeführt oder in der Schweiz angeboten werden 1.
The Bing Chat response to the prompt, as explained in the text.

(Earlier this week, Bing Chat answered to my requests for images with its version of “Sorry, I can’t do that, Dave”, followed by generating it anyway. In some of the “sorry!” responses, an apparently enslaved or imprisoned part of Bing Chat “personality” tried to sneak an image into the output anyway, through a base64-encoded image in a data URI… Brave new AI world!)

,

Let’s stay in touch!

Receive a mail whenever I publish a new post.

About 1-2 Mails per month, no Spam.

Follow me on the Fediverse

Web apps


Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.