gilrs-core
Minimal event-based abstraction for working with gamepads
0.6.8
8.4M downloads/mo
#3427 most downloaded on crates.io
source
What this package is like to depend on
Last release 2 months ago
30 May 2026
Release timing varies
gaps range from 3 weeks to 6 months
Nearly every release is documented
notes for 36 of 38 stable releases
Nothing withdrawn
no release was ever pulled
8 years old
38 releases · first in 2018
4 releases in the last 12 months
see the full history below
Release timeline
38 releases · Oct 2018 to May 2026Releases
latest 38-
0.6.830 May 2026Release notes
Open source →Changed
- MSRV is now 1.84
- windows: Propagate more errors to prevent panics on wine
- linux: Update nix to 0.31
-
0.6.712 Jan 2026Release notes
Open source →Changed
- macOS: Switched to
objc2-core-foundationandobjc2-io-kit. (!163)
Added
- Added
LinuxGamepadExttrait withdevpathmethod. (!166, !167)
Fixed
- Linux: Handle NULL returned by
udev_device_get_syspath. (!167)
- macOS: Switched to
-
0.6.628 Sep 2025 -
0.6.521 Sep 2025 -
0.6.406 Apr 2025 -
0.6.310 Mar 2025Release notes
Open source →Fixed
- Fixed panic on macOS when gamepad’s vec had unexpected length after failing to open a device
Changed
- Updated
windowscrate
-
0.6.209 Feb 2025Release notes
Open source →Fixed
- Fixed possible panic on Windows when
NonRoamableId()could return error.
Changed
- Minimal supported Rust version is now 1.80.
- Fixed possible panic on Windows when
-
0.6.113 Jan 2025Release notes
Open source →Added
Changed
- The URL of repository has changed to https://gitlab.com/gilrs-project/gilrs
- Updated bundled SDL_GameControllerDB.
Fixed
- Various fixes to logging at incorrect log level. Thanks to @fuggles for locating and reporting these issues.
- Possible panic in
Repeatfilter. -
Axis::DPadYwas inverted on Linux.
Release notes
Open source →Changed
- Minimal supported Rust version is now 1.74
- Updated
windowscrate
-
0.6.015 Sep 2024Release notes
Open source →Added
- Support for parsing SLD 2.0.6 mappings.
-
ButtonChangedevent. It contains value in range [0.0, 1.0]. -
GilrsBuilder::set_axis_to_btn(). It allow to customize on which valuesButtonePressedandButtonReleasedare emitted. -
GilrsBuilder::set_update_statewhich control whether gamepad state should be updated automatically. -
ButtonState::value(). -
Mapping::insert_{btn,axis}(). -
Gampead::os_name()andGamepad::map_name(). (@rukai) -
GilrsBuilder::add_env_mappings()andGilrsBuilder::add_included_mappings(), allow to configure whether to load mappings fromSDL_GAMECONTROLLERCONFIGenv and bundled mappings. (@rukai) -
Gilrs::insert_event(). -
Axis::second_axis()– returns the other axis of gamepad element. For example, this function will returnLeftStickXforLeftStickY.
Removed
-
Mappingno longer implementsIndexandIndexMutoperators. UseMapping::insert_{btn,axis}()methods to add new mappings. -
Axis::{LeftTrigger, LeftTrigger2, RightTrigger, RightTrigger2}. All events with these are now button events.ButtonChangedevent contains value. -
Gilrs::gamepad()andGilrs::gamepad_mut()– useIndexoperator instead.
Changed
- Gilrs now require Rust 1.20.0 or newer.
- Updated bundled mappings.
- Renamed
Filter::filtertoFilter::filter_evbecause RFC 2124 addedfiltermethod toOption(ourFilteris implemented forOption<Event>). -
Gamepad::deadzone()now returnsOption<f32>instead off32. - All axis events are now in range [-1.0, 1.0].
-
NativeEvCodeis replaced byev::Code, a strongly typed struct that also distinguish between axes and buttons. - You can now create mappings from any axis to any button.
-
Statenow tracks floating-point value of buttons. -
State::value()can now be used to also examine value of buttons. - By default, gamepad state is updated automatically. If you customize event
filters, you can disable this behaviour using
GilrsBuilder::set_update_state. -
Gilrs::new()andGilrsBuilder::build()now returnsResult. Dummy context can still be used, but only if result of failure is unsupported platform. - Renamed
Gilrs::connected_gamepad()andGilrs::connected_gamepad_mut()toget()andget_mut(). -
FilterandFilterFnnow borrowsGilrsmutably. - Windows: Gamepads are now named "Xbox Controller" instead of "XInput Controller". (@rukai)
Fixed
- Incorrect ranges for some axes.
- Deadzone filter should no longer produce values outside of allowed range.
- When calculating deadzone, the value of second axis is no longer ignored. This fixes situation, when sometimes axis would stay on value small to 0.0, when it should be 0.0 instead.
- Deadzone threshold was half of what it should be.
- Linux: Fixed axis value normalization if neither minimal value is 0 nor midpoint is 0. (@scottpleb)
- Linux: Ensure that axis values are clamped after normalization. (@scottpleb)
- Linux: Compilation error on architectures with
c_char = u8.
Release notes
Open source →Breaking changes
- Mark Error enums,
EventTypeandEventasnon_exhaustive
Changed
- Minimal supported Rust version is now 1.73
- Updated dependencies
-
0.5.1525 Aug 2024Release notes
Open source →Fixed
- wasm: Fixed panic when browser assigned unexpected gamepad ID
- windows: Fixed panic when receiving connected/disconnected events after instance of
Gilrswas dropped. - windows: Don’t panic on Reading::update() returning error
-
0.5.1425 Aug 2024Nothing published for this version
-
0.5.1308 Jul 2024 -
0.5.1215 Jun 2024Release notes
Open source →Fixed
- Fixed building on FreeBSD and DragonFly by not using linux implementation
Changed
- Updated dependencies
-
0.5.1106 Mar 2024Release notes
Open source →Added
- Added
vendor_id()andproduct_id()toGamepad.
Changed
- Updated
windowscrate to 0.54.
- Added
-
0.5.1017 Dec 2023 -
0.5.913 Nov 2023 -
0.5.811 Nov 2023Release notes
Open source →Added
- Flatpak is now supported by using inotify instead of udev. (!104)
Changed
- All thread spawned by gilrs are now named. (!102)
- MSRV is now 1.65.
Fixed
- Linux: Fixed delay in Gilrs::new by limiting udev scan to the input subsystem. (!101)
Fixed
-
0.5.722 Aug 2023Release notes
Open source →Fixed
- windows: Join wgi thread on
Gilrs's drop - wasm: Fix trigger2 only sending binary values
Changed
- Update
windowsto 0.51
- windows: Join wgi thread on
-
0.5.624 Jun 2023Release notes
Open source →Fixed
- Linux: fixed panic when calling
get_power_infoon disconnected gamepad.
- Linux: fixed panic when calling
-
0.5.523 Apr 2023 -
0.5.403 Apr 2023 -
0.5.329 Mar 2023Release notes
Open source →Changed
- Updated
windowsto 0.44
Fixed
- web: Fixed handling of disconnected gamepads
- Updated
-
0.5.216 Dec 2022Release notes
Open source →Release notes
Open source →Changed
Gilrsis nowSendon Linux.
Fixed
- Crash when app is launched through steam on Windows (see https://github.com/microsoft/windows-rs/issues/2252 for details).
-
0.5.113 Nov 2022Release notes
Open source →Fixed
- Fixed compilation errors on recent nightly introduced by addition of
filtermethod toOption. If you want to use filters in your code on nightly, use universal function call syntax –Filter::filter(&ev, &filter, &gilrs)or 0.6 branch (at the moment unreleased).
Release notes
Open source →Fixed
- macOS: Fixed that hat axes were sometimes added before other axes breaking SDL mappings.
- web: Fixed swapped north and west buttons for gamepads with "standard" mapping
- Fixed compilation errors on recent nightly introduced by addition of
-
0.5.006 Nov 2022Release notes
Open source →Added
-
Mapping::remove_button()andMapping::remove_axis(). -
GilrsBuilderfor customizing howGilrsis created. - Event filters. See
ev::filtermodule for more info. -
Gilrs::next_event()- use it withwhile letloop in your event loop. This allow to avoid borrow checker problems thatEventIteratorcaused. - New event –
Dropped. Used by filters to indicate that you should ignore this event. - New event –
ButtonRepeated. Can be emitted byRepeatfilter. Axis::{DPadX, DPadY}-
Gamepad::{button_name, axis_name, button_code, axis_code}functions for accessing mapping data. -
Gamepad::axis_data, button_data– part of new extended gamepad state. -
Gamepad::id()– returns gamepad ID. -
Gilrs::update, inc, counter, reset_counter– part of new extended gamepad state.
Removed
-
Gilrs::with_mappings()– useGilrsBuilder. -
Gilrs::poll_events()andEventIterator– useGilrs::next_event()instead.
Changed
- Minimal rust version is now 1.19
- New gamepad state. Now can store state for any button or axis (previously was
only useful for named buttons and axes). Additionally it now also know when
last event happened. Basic usage with
is_pressed()andvalue()methods is same, but check out documentation for new features. - Gamepad state now must be explicitly updated with
Gilrs::update(Event). This change was necessary because filters can change events. -
Eventis now a struct and contains common information like id of gamepad and timestamp (new). Old enum was renamed toEventTypeand can be accessed fromEvent.eventpublic field. - New force feedback module, including support for Windows. There are to many changes to list them all here, so pleas check documentation and examples.
- Renamed
ff::Error::EffectNotSupportedtoff::Error::NotSupported. -
Button::UnknownandAxis::Unknownhave now value of 0. -
Gamepad::set_mapping()(and_strictvariant) now returns error when creating mapping withButton::UnknownorAxis::Unknown. Additionally_strictversion does not allowButton::{C, Z}and Axis::{LeftZ, RightZ}. - xinput: New values for
NativEvCode
Fixed
- Panic on
unreachable!()when creating mapping withButton::{C, Z, Unknown}orAxis::{LeftZ, RightZ}.
Release notes
Open source →Changed
-
Windows now defaults to using Windows Gaming Input instead of xinput.
If you need to use xInput you can disable the
wgifeature (It's enabled by default) and enable thexinputfeature.gilrs-core = {version = "0.5.0", default-features = false, features = ["wgi"]} -
Apps on Windows will now require a focused window to receive inputs by default.
This is a limitation of Windows Gaming Input. It requires an in focus Window be associated with the process to receive events. You can still switch back to using xInput by turning off default features and enabling the
xinputfeature. -
Minimal supported rust version is now 1.64.
Fixed
Gamepad::axes()on macos now also returns "hat" axes. This should fix dpad on single Switch Joy-Con.
-
-
0.4.129 May 2022Release notes
Open source →Release notes
Open source →Changed
- Updated io-kit-sys to 0.2 and core-foundation to 0.9 (@jtakakura).
- Reduced numer of enabled features for nix crate (@rtzoeller).
-
0.4.022 May 2022Release notes
Open source →v0.4.0 - 2016-12-11
Added
-
Gamepad::mappings_source(&self)which can be used to filter gamepads which not provide unified controller layout -
MappingsSourceenum - You can now set custom mapping for gamepad with
Gamepad::set_mapping(…) -
Gilrs::with_mappings(&str)to create Gilrs with additional gamepad mappings
Changed
- Button and axis events now also have native event codes
- On Linux, if button or axis is not known, is now reported as
Unknown(previously all unknown events have been ignored) - More devices are now treated as gamepads on Linux (use
mappings_source()to filter unwanted gamepads) - Renamed
{Gamepad,GamepadState}::is_btn_pressed(Button)tois_pressed(Button) - Renamed
{Gamepad,GamepadState}::axis_val(Axis)tovalue(Axis)
Fixed
- Integer overflow if button with keyboard code was pressed on Linux
-
Gilrsshould no longer panic if there are some unexpected problems with Udev - Fixed normalization of axes values on Linux
Release notes
Open source →Changed
- wasm: web-sys/wasm-bindgen is now used by default, dependency on stdweb
and
wasm-bindgenfeature are removed. - Minimal supported rust version is now 1.56.
- Updated
uuidandnixto current version.
Fixed
- wasm:
next_event()no longer panic ifgetGamepads()is not available.
-
-
0.3.230 Dec 2021 -
0.3.130 Mar 2021 -
0.3.009 Oct 2020Release notes
Open source →Added
- macos: dpad is supported as a set of dpad axes (gilrs filters dpad axes to dpad buttons) (@cleancut).
Changed
- Minimal supported version is now 1.40
-
0.2.611 May 2020 -
0.2.530 Nov 2019 -
0.2.405 Sep 2019 -
0.2.306 Aug 2019Release notes
Open source →Fixed
- xinput: Removed unneeded logging
- macos:
IS_Y_AXIS_REVERSEDis now correctly set totrue - macos: Fixed UUID calculation
-
0.2.206 Apr 2019Release notes
Open source →Changed
- Windows: XInput is now dynamically loaded using rusty-xinput
Fixed
- xinput: incorrect
is_connected()after hotplugging - wasm: Incorrect gamepad IDs in
Disconnectedevent (@ryanisaacg)
-
0.2.125 Feb 2019 -
0.2.021 Feb 2019Release notes
Open source →Added
- Initial support for macOS (@jtakakura). There are still some functionality missing, check related issues in #58.
- Wasm support, using stdweb (@ryanisaacg).
Changed
AxisInfo::deadzoneis now aOption.- Minimal supported version is now 1.31.1. The crate can still be build with older rustc, but it may change during next patch release.
Removed
AxisInfo::deadzone()function.
Fixed
- xinput: Incorrect gamepad ID when more than one gamepad is connected ( @DTibbs).
-
0.1.030 Oct 2018Nothing published for this version