1
1
mirror of https://github.com/wez/wezterm.git synced 2024-11-23 23:21:08 +03:00

other_mouse_down as well

This commit is contained in:
Gus Wynn 2021-04-01 08:06:54 -07:00 committed by Wez Furlong
parent e84811085e
commit 76041265d6

View File

@ -1577,7 +1577,14 @@ impl WindowView {
} }
extern "C" fn other_mouse_down(this: &mut Object, _sel: Sel, nsevent: id) { extern "C" fn other_mouse_down(this: &mut Object, _sel: Sel, nsevent: id) {
Self::mouse_common(this, nsevent, MouseEventKind::Press(MousePress::Middle)); // Safety: See `other_mouse_up`
unsafe {
let button_number = NSEvent::buttonNumber(nsevent);
// See `other_mouse_up`
if [2, 4].contains(&button_number) {
Self::mouse_common(this, nsevent, MouseEventKind::Press(MousePress::Middle));
}
}
} }
extern "C" fn mouse_moved_or_dragged(this: &mut Object, _sel: Sel, nsevent: id) { extern "C" fn mouse_moved_or_dragged(this: &mut Object, _sel: Sel, nsevent: id) {