15 KiB
Change Log
See also gilrs-core changelog.
v0.11.0 - 2024-09-15
Breaking changes
- Mark Error enums,
EventTypeandEventasnon_exhaustive
Added
- Added
EventType::ForceFeedbackEffectCompleted
Changed
- Minimal supported Rust version is now 1.73
- Updated dependencies
- Updated bundled mappings
Fixed
- Fixed potential overflow in
btn_value
v0.10.6 - 2024-03-16
Fixed
axis_dpad_to_buttonfilter will now properly generate release event when axis value change from -1 to 1 (or 1 to -1) while skipping 0.
v0.10.5 - 2024-03-06
Added
- Added
vendor_id()andproduct_id()toGamepad.
v0.10.4 - 2023-12-03
Fixed
- Fixed
Gilrs::set_mapping*returningMappingError::NotConnectedfor connected gamepads. - Fix not setting other axis to 0 when in deadzone range.
v0.10.3 - 2023-11-11
Changed
- All thread spawned by gilrs are now named. (!102)
- MSRV is now 1.65.
v0.10.2 - 2023-04-23
Added
Gilrs::next_event_blocking()
Fixed
- Parse more SDL specific buttons in mappings
- Recognize "xinput" UUID in mappings
- Parse axis ranges in button mappings
v0.10.1 - 2022-11-13
Added
- Supporting files and documentation for running the GUI example using Wasm in a browser. See examples/wasm/README.md
Changed
- Bundled SDL mappings are now filtered by platform, reducing binary size.
Fixed
- GUI example crash when the current platform does not support force feedback.
v0.10.0 - 2022-11-06
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 = {version = "0.10.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.Note: Some (Older?) devices may still report inputs without a window but this is not the case for all devices so if you are writing a terminal based game, use the
xinputfeature instead. -
Minimal supported rust version is now 1.64.
v0.9.0 - 2022-05-22
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.
- Changed
impl Into\<usize\> for GamepadIdtoimpl From\<GamepadId\> for usize
Fixed
- wasm:
next_event()no longer panic ifgetGamepads()is not available.
v0.8.2 - 2021-12-30
Changed
- Minimal supported rust version is now 1.47
axis_dpad_to_btnnow also emitsButtonChangedevents
Fixed
- Fixed overflow when calculating axis value and min/max range was i32::MIN/MAX (@wathiede)
v0.8.1 - 2021-03-30
Changed
- Updated bundled mappings
v0.8.0 - 2020-10-09
Added
Jitter,Repeat,GilrsBuilder, andMappingnow implementDefault.- Errors now implement
source(). Codenow implementsDeserializeandSerialize(@theunkn0wn1).- Dpad is now supported on macOS (@cleancut).
Changed
- Minimal supported version is now 1.40
- Non exhaustive enums now use
#[non_exhaustive]instead of hidden variant. - Renamed cargo feature
serdetoserde-serialize. - Improved conversion of axis value to float. Values like 127 (when axis range is 0-255) will now be correctly converted to 0.0.
Removed
- Errors now longer implement deprecated methods (
source()anddescription()).
v0.7.4 - 2020-02-06
Added
- Added method to stop playing force feedback effect. (@photex)
Fixed
- Fixed bug that caused forced feedback effects to never stop. (@photex)
v0.7.3 - 2019-11-30
Added
- Added support for serialization and deserialization for
Button,AxisandAxisOrButtonwith optionalserdefeature (@aleksijuvani).
Fixed
- Fixed defaults mappings containing elements that gamepad doesn't have.
This also fixes state not working for
LeftTriggerbutton on Windows.
v0.7.2 - 2019-08-06
Fixed
- Fixed loading mappings for wrong platform
v0.7.1 - 2019-03-04
Fixed
- Compilation on macOS.
- xinput: Calling
set_ff_state()on devices that were never connected. GamepadIdwas not reexported from private module.
v0.7.0 - 2019-02-21
Added
GamepadIdGilrs::gamepad(id). This function is replacement forIndexoperator and can return disconnected gamepads.- Initial support for macOS (@jtakakura). There are still some functionality missing, check related issues in #58.
- Wasm support, using stdweb (@ryanisaacg).
Changed
- Change
Gamepad::uuid -> UuidtoGamepad::uuid -> [u8; 16] gilrsnow usesgilrs-corecrate as backend. Because of it, there are some breaking changes to API.- Functions that returned
&Gamepadnow returnGamepad<'_>proxy object. - Renamed
Gilrs::get(id)toGilrs::connected_gamepad(id). - Moved
Gamepad::set_mapping{,_strict}()toGilrs. These functions now also take gamepad id as additional argument. - 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.
- Instead using
usizefor gamepad ID,GamepadIdis now used. - Updated bundled SDL_GameControllerDB.
Removed
- All functions that returned
&mut Gamepad. Gilrsno longer implementsIndexandIndexMutoperators. UseGilrs::gamepad(id)instead.Gamepad::status()andStatusenum.Gamepad::is_connected()is now sufficient to determine status of gamepad.
Fixed
- xinput: Incorrect gamepad ID when more than one gamepad is connected (@DTibbs).
- Deadzone filter no longer emits additional events. This resulted in emitting more events until values normalized on some, often unrelated (like 0 for axis around 0.5), value.
- Mappings from environment variable had lower priority than bundled mappings.
v0.6.1 - 2018-07-18
Added
ev::Code::into_u32()(@rukai).ev::{Button, Axis, AxisOrBtn}now implementsHash(@sheath).
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.
v0.6.0 - 2018-02-11
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.
v0.5.0 - 2017-09-24
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}.
v0.4.4 — 2017-06-16
Changed
- Gilrs no longer uses
ioctlcrate on Linux. Becauseioctlwas deprecated and all versions yanked, it was causing problems for new builds that didn't haveioctlcrate listed in Cargo.lock.
v0.4.3 — 2017-03-12
Added
- You can now iterate over mutable references to connected gamepads using
Gilrs::gamepads_mut().
Fixed
- Fixed
unreachable!()panic on 32bit Linux - Improved converting axes values to
f32when using XInput
v0.4.2 - 2017-01-15
Changed
- Updated SDL_GameControllerDB to latest revision.
- Changes in axes values that are less than 1% are now ignored.
Fixed
- Fixed multiple axes mapped to same axis name when mappings are incomplete.
- Values returned with
AxisChangedevent now have correctly applied deadzones. - Linux: Correctly handle event queue overrun.
v0.4.1 - 2016-12-12
Fixed
- Type inference error introduced by generic index in
<[T]>::get
v0.4.0 - 2016-12-11
Added
Gamepad::mappings_source(&self)which can be used to filter gamepads which not provide unified controller layoutMappingsSourceenum- 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
v0.3.1 - 2016-09-23
Fixed
- Fixed compilation error on non-x86_64 Linux
v0.3.0 - 2016-09-22
Added
Gamepad::power_info(&self)ff::Direction::from_radians(f32)andff::Direction::from_vector([f32; 2])Gilrs::gamepads(&self)which returns iterator over all connected gamepadsGamepadStatenow implementsis_btn_pressed(Button)andaxis_val(Axis)Gilrsnow implementsIndexandIndexMut
Changed
- Rename
Button::UnknowtoButton::Unknown Gamepad::name(&self)now returns&strinstead of&String- Improved dead zone detection
Effect::play(&self, u16)now returnsResult<(), Error>- Linux: Reduced memory usage
Removed
ff::Directionno longer implementsFrom<f32>
Fixed
- Buttons west and east are no longer swapped when using SDL2 mappings
- Linux: infinite loop after gamepad disconnects
- Linux: SDL2 mappings for gamepads that can also report mouse and keyboard events now should works
v0.2.0 - 2016-08-18
Changed
- Rename
Gilrs::pool_events()toGilrs::poll_events()
Fixed
- Linux: Disconnected events are now emitted properly
- Linux: All force feedback effects are now dropped when gamepad disconnects