libUIOHook: Cross-platform keyboard and mouse hooking from userland.

December 30, 2025 ยท View on GitHub

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.

Compiling

Prerequisites:

  • cmake
  • gcc, clang or msvc
  • x11 dependencies:
    • libx11-dev
    • libxtst-dev
    • libxt-dev
    • libxinerama-dev
    • libx11-xcb-dev
    • libxkbcommon-dev
    • libxkbcommon-x11-dev
    • libxkbfile-dev
$ git clone https://github.com/kwhat/libuiohook
$ cd libuiohook
$ mkdir build && cd build
$ cmake -S .. -D BUILD_SHARED_LIBS=ON -D BUILD_DEMO=ON -DCMAKE_INSTALL_PREFIX=../dist
$ cmake --build . --parallel 2 --target install

Configuration

optiondescriptiondefault
allBUILD_DEMO:BOOLdemo applicationsOFF
BUILD_SHARED_LIBS:BOOLshared libraryON
ENABLE_TEST:BOOLtestingOFF
USE_EPOCH_TIME:BOOLunix epch event timesOFF
OSXUSE_APPLICATION_SERVICES:BOOLframeworkON
USE_IOKIT:BOOLframeworkON
USE_APPKIT:BOOLobj-c apiON
Win32
LinuxUSE_EVDEV:BOOLgeneric input driverON
*nixUSE_XF86MISC:BOOLxfree86-misc extensionOFF
USE_XINERAMA:BOOLxinerama libraryON
USE_XRANDR:BOOLxrandt extensionOFF
USE_XT:BOOLx toolkit extensionON

Usage