imgui-gilrs

Crates.ioimgui-gilrs
lib.rsimgui-gilrs
version0.1.0
sourcesrc
created_at2023-09-17 11:17:51.320376
updated_at2023-09-17 11:17:51.320376
descriptionGamepad navigation support for imgui
homepagehttps://github.com/Calcoph/imgui-gilrs
repositoryhttps://github.com/Calcoph/imgui-gilrs
max_upload_size
id975038
size78,742
Diego (Calcoph)

documentation

README

Crate to send gilrs gamepad events to imgui for gamepad navigation.

Usage

Create a GamepadHandler using GamepadHandler::new() before the main loop.

Call GamepadHandler::handle_event() for every gilrs event (or every winit event if winit feature is enabled).

Make sure to enable gamepad navigation on your imgui application:

let io = Context::io_mut();
io.config_flags |= imgui::ConfigFlags::NAV_ENABLE_GAMEPAD;

See Troubleshooting if encountering any issue.

Features

  • winit: allows GamepadHandler::handle_event() to also call WinitPlatform::handle_event()

Troubleshooting

If using the imgui-wgpu crate, and the program crashes when opening the window menu (hold X on XBOX or Square on PlayStation) then you must use commit 89394e0 or later of the crate. You can do that by inserting the following in your Cargo.toml:

[patch.crates-io]
imgui-wgpu = { git = "https://github.com/Yatekii/imgui-wgpu-rs", rev = "89394e0" }
Commit count: 11

cargo fmt