kwhat/libuiohook

A multi-platform C library to provide global keyboard and mouse hooks from userland.

C

613

624 commits

updated Jul 27, 2026

See the code

README

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

build-binaires

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
OSXUSE_APPLICATION_SERVICES:BOOLframeworkON
USE_IOKIT:BOOLframeworkON
USE_OBJC:BOOLobj-c apiON
USE_CARBON_LEGACY:BOOLlegacy frameworkOFF
Win32
LinuxUSE_EVDEV:BOOLgeneric input driverON
*nixUSE_XF86MISC:BOOLxfree86-misc extensionOFF
USE_XINERAMA:BOOLxinerama libraryON
USE_XKB_COMMON:BOOLxkbcommon extensionON
USE_XKB_FILE:BOOLxkb-file extensionON
USE_XRANDR:BOOLxrandt extensionOFF
USE_XRECORD_ASYNC:BOOLxrecord async apiOFF
USE_XT:BOOLx toolkit extensionON
USE_XTEST:BOOLxtest extensionON

Usage

c
global-hotkeys
keyboard-hooks
mouse-hooks
multi-platform

kwhat/libuiohook

A multi-platform C library to provide global keyboard and mouse hooks from userland.

C

613

624 commits

updated Jul 27, 2026

See the code

README

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

build-binaires

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
OSXUSE_APPLICATION_SERVICES:BOOLframeworkON
USE_IOKIT:BOOLframeworkON
USE_OBJC:BOOLobj-c apiON
USE_CARBON_LEGACY:BOOLlegacy frameworkOFF
Win32
LinuxUSE_EVDEV:BOOLgeneric input driverON
*nixUSE_XF86MISC:BOOLxfree86-misc extensionOFF
USE_XINERAMA:BOOLxinerama libraryON
USE_XKB_COMMON:BOOLxkbcommon extensionON
USE_XKB_FILE:BOOLxkb-file extensionON
USE_XRANDR:BOOLxrandt extensionOFF
USE_XRECORD_ASYNC:BOOLxrecord async apiOFF
USE_XT:BOOLx toolkit extensionON
USE_XTEST:BOOLxtest extensionON

Usage

c
global-hotkeys
keyboard-hooks
mouse-hooks
multi-platform

Significant stargazers

itchyny

1,261 followers · starred Nov 2020

CJ Pais

922 followers · starred Jan 2026

Dimitriy Ryazantcev

39 followers · starred Nov 2020

John Regan

117 followers · starred Dec 2021