You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Get the difference between the new and old sets.
let new_buttons = &buttons - &prev_buttons;
let old_buttons = &prev_buttons - &buttons;
if !new_buttons.is_empty() || !old_buttons.is_empty(){
println!(
"X = {:?}, Y = {:?} : {:?} -> {:?}",
state.x(),
state.y(),
new_buttons,
old_buttons
);
A left-click (mouse-down, then mouse-up) inside the window generates this output:
X = 605, Y = 300 : {Left} -> {}
X = 605, Y = 300 : {} -> {Left}
Shouldn't this order be reversed? I would expect to see:
X = 605, Y = 300 : {} -> {Left}
X = 605, Y = 300 : {Left} -> {}
More output:
X = 605, Y = 300 : {Left} -> {}
X = 605, Y = 300 : {} -> {Left}
X = 828, Y = 161 : {Right} -> {}
X = 828, Y = 161 : {} -> {Right}
X = 232, Y = 312 : {Left} -> {}
X = 232, Y = 312 : {} -> {Left}
X = 234, Y = 337 : {Left} -> {}
X = 234, Y = 337 : {} -> {Left}
X = 712, Y = 134 : {Right} -> {}
X = 712, Y = 134 : {} -> {Right}
X = 813, Y = 283 : {Right} -> {}
X = 813, Y = 283 : {} -> {Right}
The text was updated successfully, but these errors were encountered:
In the
mouse-state
example, the changes to the mouse's button states are logged as"${new_buttons} -> ${old_buttons}"
:rust-sdl2/examples/mouse-state.rs
Lines 40 to 51 in f2f1e29
A left-click (mouse-down, then mouse-up) inside the window generates this output:
Shouldn't this order be reversed? I would expect to see:
More output:
The text was updated successfully, but these errors were encountered: