@@ -64,6 +64,8 @@ pub const kCGEventMaskForAllEvents: u64 = (1 << CGEventType::LeftMouseDown as u6
6464 + ( 1 << CGEventType :: LeftMouseUp as u64 )
6565 + ( 1 << CGEventType :: RightMouseDown as u64 )
6666 + ( 1 << CGEventType :: RightMouseUp as u64 )
67+ + ( 1 << CGEventType :: OtherMouseDown as u64 )
68+ + ( 1 << CGEventType :: OtherMouseUp as u64 )
6769 + ( 1 << CGEventType :: MouseMoved as u64 )
6870 + ( 1 << CGEventType :: LeftMouseDragged as u64 )
6971 + ( 1 << CGEventType :: RightMouseDragged as u64 )
@@ -168,6 +170,18 @@ pub unsafe fn convert(
168170 CGEventType :: LeftMouseUp => Some ( EventType :: ButtonRelease ( Button :: Left ) ) ,
169171 CGEventType :: RightMouseDown => Some ( EventType :: ButtonPress ( Button :: Right ) ) ,
170172 CGEventType :: RightMouseUp => Some ( EventType :: ButtonRelease ( Button :: Right ) ) ,
173+ CGEventType :: OtherMouseDown => {
174+ match cg_event. get_integer_value_field ( EventField :: MOUSE_EVENT_BUTTON_NUMBER ) {
175+ 2 => Some ( EventType :: ButtonPress ( Button :: Middle ) ) ,
176+ event => Some ( EventType :: ButtonPress ( Button :: Unknown ( event as u8 ) ) ) ,
177+ }
178+ }
179+ CGEventType :: OtherMouseUp => {
180+ match cg_event. get_integer_value_field ( EventField :: MOUSE_EVENT_BUTTON_NUMBER ) {
181+ 2 => Some ( EventType :: ButtonRelease ( Button :: Middle ) ) ,
182+ event => Some ( EventType :: ButtonRelease ( Button :: Unknown ( event as u8 ) ) ) ,
183+ }
184+ }
171185 CGEventType :: MouseMoved => {
172186 let point = cg_event. location ( ) ;
173187 Some ( EventType :: MouseMove {
0 commit comments