A tool like Android getevent that is being developed for use in XtMapper to support waydroid.
Download executable binary from releases.
It is advisable to build the client from source instead so that it can link against the system libraries.
$ chmod a+x ./client
$ ./client | sudo waydroid shell -- sh /sdcard/Android/data/xtr.keymapper/files/xtMapper.sh --wayland-client
-
This hack may be needed if xtMapper.sh can't be found. It will also fail to write the script if waydroid container is rooted. In that case unroot the waydroid container and try again. The app doesn't require root access to work.
Or write the script manually with the command from Alternate method:$ echo 'exec <app_process command here> "$@"' | sudo tee ~/.local/share/waydroid/data/media/0/Android/data/xtr.keymapper/files/xtMapper.sh
-
If cursor is invisible, enable cursor on subsurface
$ waydroid prop set persist.waydroid.cursor_on_subsurface true
-
This will create an invisible wayland window named "XtMapper" from which keyboard and mouse input events are captured and then forwarded to XtMapper.
-
For it to work as intended, it's size should be same as that of the waydroid window and overlay the waydroid window.
-
Auto Profiling should be disabled in settings.
- Direct touchmap mode feature doesn't work, but you can use a simple udev hack:
We actually have to changeID_INPUT_TOUCHPAD
toID_INPUT_TOUCHSCREEN
. So the following command would do that easily:
sudo find /run/udev -type f -exec sed -i 's/ID_INPUT_TOUCHPAD/ID_INPUT_TOUCHSCREEN/g' {} \;
To revert:
sudo find /run/udev -type f -exec sed -i 's/ID_INPUT_TOUCHSCREEN/ID_INPUT_TOUCHPAD/g' {} \;
Works fine on plasma 6.1.5 and Arch Linux.
Also recommend enabling "Touch points" from System Settings > Window Management > Desktop effects to visualize touches.
Depends on libwayland-client and libxkbcommon. You will need to have some system dependencies such as a C compiler installed for compiling it from source with make.
# Arch Linux
sudo pacman -S wayland-protocols libxkbcommon
# Ubuntu
sudo apt install wayland-protocols libwayland-client0 libwayland-dev libxkbcommon-dev
Download the source
git clone https://github.com/Xtr126/wayland-getevent
cd wayland-getevent
Run make to build the client binary
$ make
A script build.sh is included to download all dependencies and build a static binary without requiring libxkbcommon, wayland to be installed on system. Requires meson and ninja.
$ ./build.sh