opengl: cocoa - do not perform the default mouse events for NSOpenGLView, to prevent duplicated event handling. #33067

git-svn-id: trunk@57172 -
This commit is contained in:
dmitry 2018-01-28 04:18:40 +00:00
parent 136cb7bb8e
commit 1d82a118e9

View File

@ -436,44 +436,51 @@ end;
procedure TCocoaOpenGLView.mouseDown(event: NSEvent);
begin
if not Assigned(callback) or not callback.MouseUpDownEvent(event) then
inherited mouseDown(event);
if Assigned(callback)
then callback.MouseUpDownEvent(event)
else inherited mouseDown(event);
end;
procedure TCocoaOpenGLView.mouseUp(event: NSEvent);
begin
if not Assigned(callback) or not callback.MouseUpDownEvent(event) then
inherited mouseUp(event);
if Assigned(callback)
then callback.MouseUpDownEvent(event)
else inherited mouseUp(event);
end;
procedure TCocoaOpenGLView.rightMouseDown(event: NSEvent);
begin
if not Assigned(callback) or not callback.MouseUpDownEvent(event) then
inherited rightMouseDown(event);
if Assigned(callback)
then callback.MouseUpDownEvent(event)
else inherited rightMouseDown(event);
end;
procedure TCocoaOpenGLView.rightMouseUp(event: NSEvent);
begin
if not Assigned(callback) or not callback.MouseUpDownEvent(event) then
inherited rightMouseUp(event);
if Assigned(callback)
then callback.MouseUpDownEvent(event)
else inherited rightMouseUp(event);
end;
procedure TCocoaOpenGLView.otherMouseDown(event: NSEvent);
begin
if not Assigned(callback) or not callback.MouseUpDownEvent(event) then
inherited otherMouseDown(event);
if Assigned(callback)
then callback.MouseUpDownEvent(event)
else inherited otherMouseDown(event);
end;
procedure TCocoaOpenGLView.otherMouseUp(event: NSEvent);
begin
if not Assigned(callback) or not callback.MouseUpDownEvent(event) then
inherited otherMouseUp(event);
if Assigned(callback)
then callback.MouseUpDownEvent(event)
else inherited otherMouseUp(event);
end;
procedure TCocoaOpenGLView.mouseDragged(event: NSEvent);
begin
if not Assigned(callback) or not callback.MouseMove(event) then
inherited mouseDragged(event);
if Assigned(callback)
then callback.MouseMove(event)
else inherited mouseDragged(event);
end;
procedure TCocoaOpenGLView.mouseEntered(event: NSEvent);
@ -488,14 +495,16 @@ end;
procedure TCocoaOpenGLView.mouseMoved(event: NSEvent);
begin
if not Assigned(callback) or not callback.MouseMove(event) then
inherited mouseMoved(event);
if Assigned(callback)
then callback.MouseMove(event)
else inherited mouseMoved(event);
end;
procedure TCocoaOpenGLView.scrollWheel(event: NSEvent);
begin
if not Assigned(callback) or not callback.scrollWheel(event) then
inherited scrollWheel(event);
if not Assigned(callback)
then callback.scrollWheel(event)
else inherited scrollWheel(event);
end;
procedure TCocoaOpenGLView.keyDown(event: NSEvent);