0xStubs

System Administration, Programming and Reconfigurable Computing

Making Touchpads with Builtin Windows Gestures Less Annoying on Raspberry Pi OS

I use a Bluetooth keyboard with included touchpad to control a Raspberry Pi 4. To be specific, I use the Keysonic KSK-5220BT by RaidSonic. One thing that annoys me for some time now is: Whenever I touch the touchpad at the very edge, the LXDE menu will open and the cursor won’t move.

The reason is that the touchpad supports Windows swipe gestures. For whatever reason these gestures are (at least with this touchpad) not recognized in software but in hardware and are translated as follows:

  • Swipe from right edge > Windows + A
  • Swipe from bottom edge > Windows + B
  • Swipe from left edge > Windows + Tab
  • Swipe from top edge > Windows + Down

Raspberry Pi OS (formerly Raspbian) has a large set of key binding preconfigured in /etc/xdg/openbox/lxde-pi-rc.xml. In particular, every press of the Windows / Super key will open the application menu. So each of these swipe gestures will open the menu and issue an additional key press (A / B / Tab / Down).

A workaround is to edit that file and replace

<keybind key="Super_L">
  <action name="Execute">
    <command>lxpanelctl menu</command>
  </action>
</keybind>

by

<keybind key="W-a">
  <action name="Execute">
    <command>true</command>
  </action>
</keybind>
<keybind key="W-b">
  <action name="Execute">
    <command>true</command>
  </action>
</keybind>
<keybind key="W-Down">
  <action name="Execute">
    <command>true</command>
  </action>
</keybind>
<keybind key="W-Tab">
  <action name="Execute">
    <command>true</command>
  </action>
</keybind>

With this modification, the cursor still won’t move when touching the edge of the touchpad. But at least no action is triggered and no key press is issued. But be aware that an update of the raspberrypi-ui-mods package might overwrite these changes.

Update Mar 11, 2023:

In 2021 Raspberry Pi OS updated to Debian Bullseye as a foundation. Additionally, they changed the default window manager from Openbox to Mutter on all devices with more than 2 GiB of memory. For Mutter, the procedure for disabling the annoying key bindings is slightly different:

  1. Disable Mutters key binding for the Windows / Super key:
    gsettings set org.gnome.mutter.keybindings lxpanel-menu "[]"
  2. Install xbindkeys:
    apt install xbindkeys
  3. Create a file called .xbindkeysrc in your home directory with the following content:
    "true"
       Super_L a
    
    "true"
       Super_L b
    
    "true"
       Super_L Tab
    
    "true"
       Super_L Down
    
  4. Manually start xbindkeys or logout and login again.

Leave a Reply

Your email address will not be published. Required fields are marked *

Captcha loading...