Skip to content

Commit

Permalink
Fix modifiers on Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
emilk committed Dec 6, 2023
1 parent bc5c6d1 commit a13959a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions crates/egui-winit/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -388,12 +388,12 @@ impl State {
}
}
WindowEvent::ModifiersChanged(state) => {
use winit::keyboard::ModifiersKeyState::Pressed;
let state = state.state();

let alt = state.lalt_state() == Pressed || state.ralt_state() == Pressed;
let ctrl = state.lcontrol_state() == Pressed || state.rcontrol_state() == Pressed;
let shift = state.lshift_state() == Pressed || state.rshift_state() == Pressed;
let super_ = state.lsuper_state() == Pressed || state.rsuper_state() == Pressed;
let alt = state.alt_key();
let ctrl = state.control_key();
let shift = state.shift_key();
let super_ = state.super_key();

self.egui_input.modifiers.alt = alt;
self.egui_input.modifiers.ctrl = ctrl;
Expand Down

0 comments on commit a13959a

Please sign in to comment.