Skip to content

Commit cee1682

Browse files
authored
Merge pull request #1 from imgui-rs/updating-0.14-imgui
updating for new imgui
2 parents 4c9fc03 + cc260c4 commit cee1682

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@ license = "MIT OR Apache-2.0"
1010
categories = ["gui"]
1111

1212
[dependencies]
13-
imgui = "0.12.0"
14-
winit = { version = "0.30", default-features = false }
13+
imgui = { git = "https://github.com/imgui-rs/imgui-rs", version = "0.12" }
14+
winit = { version = "0.30", default-features = false }

src/lib.rs

+8-8
Original file line numberDiff line numberDiff line change
@@ -191,10 +191,10 @@ impl WinitPlatform {
191191
// We need to track modifiers separately because some system like macOS, will
192192
// not reliably send modifier states during certain events like ScreenCapture.
193193
// Gotta let the people show off their pretty imgui widgets!
194-
io.add_key_event(Key::ModShift, state.shift_key());
195-
io.add_key_event(Key::ModCtrl, state.control_key());
196-
io.add_key_event(Key::ModAlt, state.alt_key());
197-
io.add_key_event(Key::ModSuper, state.super_key());
194+
io.add_key_event(Key::LeftShift, state.shift_key());
195+
io.add_key_event(Key::LeftCtrl, state.control_key());
196+
io.add_key_event(Key::LeftAlt, state.alt_key());
197+
io.add_key_event(Key::LeftSuper, state.super_key());
198198
}
199199
WindowEvent::KeyboardInput { ref event, .. } => {
200200
if event.state.is_pressed() {
@@ -506,10 +506,10 @@ fn to_imgui_key(key: winit::keyboard::Key, location: KeyLocation) -> Option<Key>
506506

507507
fn handle_key_modifier(io: &mut Io, key: &WinitKey, down: bool) {
508508
match key {
509-
WinitKey::Named(NamedKey::Shift) => io.add_key_event(imgui::Key::ModShift, down),
510-
WinitKey::Named(NamedKey::Control) => io.add_key_event(imgui::Key::ModCtrl, down),
511-
WinitKey::Named(NamedKey::Alt) => io.add_key_event(imgui::Key::ModAlt, down),
512-
WinitKey::Named(NamedKey::Super) => io.add_key_event(imgui::Key::ModSuper, down),
509+
WinitKey::Named(NamedKey::Shift) => io.add_key_event(imgui::Key::LeftShift, down),
510+
WinitKey::Named(NamedKey::Control) => io.add_key_event(imgui::Key::LeftCtrl, down),
511+
WinitKey::Named(NamedKey::Alt) => io.add_key_event(imgui::Key::LeftAlt, down),
512+
WinitKey::Named(NamedKey::Super) => io.add_key_event(imgui::Key::LeftSuper, down),
513513
_ => {}
514514
}
515515
}

0 commit comments

Comments
 (0)