Skip to content

Xtr126/wayland-getevent

Repository files navigation

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.


Usage

$ chmod a+x ./client
$ ./client | sudo waydroid shell -- sh /sdcard/Android/data/xtr.keymapper/files/xtMapper.sh --wayland-client

Important

  • 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.

  • Minimize the client window and click on start button in XtMapper app, then maximize the client window back.

  • For it to work as intended, it's size should be same as that of the waydroid window and overlay the waydroid window.

  • If it launched fine, "using wayland client" will be output on the terminal.

  • Auto Profiling should be disabled in settings.

Note

This tool has been discontinued. An alternative version by using a modified version of cage as passthrough compositor is being worked on. More details

image


Building the client from source

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