Note
This is a fork of libuiohook that exists solely for the needs of SharpHook. It is not intended for general-purpose usage that's not related to SharpHook.
Prerequisites:
- CMake - at least version 4.2
- GCC, Clang, or MSVC
- X11 dependencies:
- libx11-dev
- libxtst-dev
- libxrandr-dev
- libxt-dev
- libx11-xcb-dev
- libxkbcommon-dev
- libxkbcommon-x11-dev
- libxkbfile-dev
To build, run the following commands:
git clone https://github.com/TolikPylypchuk/libuiohook
cd libuiohook
mkdir build && cd build
cmake -S .. -D BUILD_DEMO=ON -D CMAKE_INSTALL_PREFIX=../dist
cmake --build . --parallel 2 --target installOn Windows, add CMake parameters -G "Visual Studio 18 2026" and -D CMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded.
On macOS and Linux, add CMake parameter -G "Unix Makefiles".
On macOS, you can add the MAC_CATALYST=ON option to build libuiohook for Mac Catalyst instead of macOS.
You can optionally add the BUILD_DEMO=ON option to build demo applications, and BUILD_TEST=ON to build tests.
Note that on Linux, tests require X11 to be present, so they cannot run in headless environments like CI pipelines.