Change ModifiersState to a bitflags struct (#1306)
* Change ModifiersState to a bitflags struct * Make examples work * Add modifier state methods * all things considered, only erroring out in one file throughout all of these changes is kinda impressive * Make expansion plans more clear * Move changelog entry * Try to fix macos build * Revert modifiers println in cursor_grab * Make serde serialization less bug-prone
This commit is contained in:
parent
027c52171d
commit
20e81695ca
15 changed files with 190 additions and 93 deletions
|
|
@ -60,7 +60,7 @@ fn main() {
|
|||
..
|
||||
} => {
|
||||
window.set_title(&format!("{:?}", key));
|
||||
let state = !modifiers.shift;
|
||||
let state = !modifiers.shift();
|
||||
use VirtualKeyCode::*;
|
||||
match key {
|
||||
A => window.set_always_on_top(state),
|
||||
|
|
@ -81,7 +81,7 @@ fn main() {
|
|||
video_modes.iter().nth(video_mode_id).unwrap()
|
||||
);
|
||||
}
|
||||
F => window.set_fullscreen(match (state, modifiers.alt) {
|
||||
F => window.set_fullscreen(match (state, modifiers.alt()) {
|
||||
(true, false) => {
|
||||
Some(Fullscreen::Borderless(window.current_monitor()))
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue