Skip to content

Commit

Permalink
switch to just button 2
Browse files Browse the repository at this point in the history
  • Loading branch information
guswynn authored and wez committed Apr 1, 2021
1 parent 7604126 commit b057e1f
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions window/src/os/macos/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1501,9 +1501,8 @@ impl WindowView {
unsafe {
let button_number = NSEvent::buttonNumber(nsevent);
// Button 2 is the middle mouse button (scroll wheel)
// At least on the tested mouse, the dedicated middle mouse button
// is button 4. This should probably be made configurable at some point
if [2, 4].contains(&button_number) {
// but is the dedicated middle mouse button on 4 button mouses
if button_number == 2 {
Self::mouse_common(this, nsevent, MouseEventKind::Release(MousePress::Middle));
}
}
Expand Down Expand Up @@ -1581,7 +1580,7 @@ impl WindowView {
unsafe {
let button_number = NSEvent::buttonNumber(nsevent);
// See `other_mouse_up`
if [2, 4].contains(&button_number) {
if button_number == 2 {
Self::mouse_common(this, nsevent, MouseEventKind::Press(MousePress::Middle));
}
}
Expand Down

0 comments on commit b057e1f

Please sign in to comment.