Mouse input can now be disabled completely in Cocoa backend

This commit is contained in:
alexey.lysiuk 2017-03-25 11:04:06 +02:00
parent 04057b8b91
commit 80f3c1ed81

View file

@ -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]