Gainput is the awesome C++ input library for your game. It's easy to use, open source and cross-platform.

Download v1.0.0 Browse Source API Docs
By the way, it's pronounced: gain-put, IPA: geɪn-pʊt. As in gain input. Or as in game input.

Nice Code

Gainput's code is clean, easy to understand and lightweight. It's also easy to use and might make you a happier person.


Gainput provides the same interface (more or less) on all supported platforms. Currently, implementations are provided for: Android NDK, iOS/tvOS, Linux, macOS, and Windows.

Basic Features

Gainput provides low-level and high-level interfaces. Query the state of devices buttons directly or map device buttons to a user button.

Open Source

Gainput is Open Source and licensed under the MIT license. So feel free to use it, share it, change it. Whatever you like.

All the Devices

Gainput aims to support all available input devices. Implementations are provided for keyboard, mouse, gamepad, multi-touch surfaces and built-in sensors.

Advanced Features

Recording/playback of input sequences, syncing of inputs across the network, helpers to support remapping of buttons by the player, and more. Most features can be disabled if not needed.