From 80f3c1ed81943eb69e3a530608b3d590790e1a4c Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Sat, 25 Mar 2017 11:04:06 +0200 Subject: [PATCH] Mouse input can now be disabled completely in Cocoa backend --- src/posix/cocoa/i_input.mm | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/posix/cocoa/i_input.mm b/src/posix/cocoa/i_input.mm index 53afa8536..08745e687 100644 --- a/src/posix/cocoa/i_input.mm +++ b/src/posix/cocoa/i_input.mm @@ -626,6 +626,11 @@ void ProcessKeyboardFlagsEvent(NSEvent* theEvent) void ProcessMouseMoveEvent(NSEvent* theEvent) { + if (!use_mouse) + { + return; + } + if (GUICapture) { ProcessMouseMoveInMenu(theEvent); @@ -638,6 +643,11 @@ void ProcessMouseMoveEvent(NSEvent* theEvent) void ProcessMouseButtonEvent(NSEvent* theEvent) { + if (!use_mouse) + { + return; + } + event_t event = {}; const NSEventType cocoaEventType = [theEvent type]; @@ -690,6 +700,11 @@ void ProcessMouseButtonEvent(NSEvent* theEvent) void ProcessMouseWheelEvent(NSEvent* theEvent) { + if (!use_mouse) + { + return; + } + const int16_t modifiers = ModifierFlagsToGUIKeyModifiers(theEvent); const CGFloat delta = (modifiers & GKM_SHIFT) ? [theEvent deltaX]