Skip to content

Commit

Permalink
Disable input handling on MacOS.
Browse files Browse the repository at this point in the history
Don't swallow event, instead push further
  • Loading branch information
kissandras committed Dec 10, 2020
1 parent 0324c6b commit 13904fc
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions Sources/MacOSAppSupport/MAS_NodeEditorNSViewControl.mm
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ - (void) drawRect : (NSRect) dirtyRect
- (void) mouseDown : (NSEvent*) event
{
if (!nodeEditorControl->IsInputHandlingEnabled ()) {
[super mouseDown: event];
return;
}
NUIE::Point position = MAS::GetViewPositionFromEvent (self, event);
Expand All @@ -64,6 +65,7 @@ - (void) mouseDown : (NSEvent*) event
- (void) mouseUp : (NSEvent*) event
{
if (!nodeEditorControl->IsInputHandlingEnabled ()) {
[super mouseUp: event];
return;
}
NUIE::Point position = MAS::GetViewPositionFromEvent (self, event);
Expand All @@ -74,6 +76,7 @@ - (void) mouseUp : (NSEvent*) event
- (void) rightMouseDown : (NSEvent*) event
{
if (!nodeEditorControl->IsInputHandlingEnabled ()) {
[super rightMouseDown: event];
return;
}
NUIE::Point position = MAS::GetViewPositionFromEvent (self, event);
Expand All @@ -84,6 +87,7 @@ - (void) rightMouseDown : (NSEvent*) event
- (void) rightMouseUp : (NSEvent*) event
{
if (!nodeEditorControl->IsInputHandlingEnabled ()) {
[super rightMouseUp: event];
return;
}
NUIE::Point position = MAS::GetViewPositionFromEvent (self, event);
Expand All @@ -94,6 +98,7 @@ - (void) rightMouseUp : (NSEvent*) event
- (void) otherMouseDown : (NSEvent*) event
{
if (!nodeEditorControl->IsInputHandlingEnabled ()) {
[super otherMouseDown: event];
return;
}
NUIE::Point position = MAS::GetViewPositionFromEvent (self, event);
Expand All @@ -104,6 +109,7 @@ - (void) otherMouseDown : (NSEvent*) event
- (void) otherMouseUp : (NSEvent*) event
{
if (!nodeEditorControl->IsInputHandlingEnabled ()) {
[super otherMouseUp: event];
return;
}
NUIE::Point position = MAS::GetViewPositionFromEvent (self, event);
Expand All @@ -114,6 +120,7 @@ - (void) otherMouseUp : (NSEvent*) event
- (void) mouseDragged : (NSEvent*) event
{
if (!nodeEditorControl->IsInputHandlingEnabled ()) {
[super mouseDragged: event];
return;
}
NUIE::Point position = MAS::GetViewPositionFromEvent (self, event);
Expand All @@ -124,6 +131,7 @@ - (void) mouseDragged : (NSEvent*) event
- (void) rightMouseDragged : (NSEvent*) event
{
if (!nodeEditorControl->IsInputHandlingEnabled ()) {
[super rightMouseDragged: event];
return;
}
NUIE::Point position = MAS::GetViewPositionFromEvent (self, event);
Expand All @@ -134,6 +142,7 @@ - (void) rightMouseDragged : (NSEvent*) event
- (void) otherMouseDragged : (NSEvent*) event
{
if (!nodeEditorControl->IsInputHandlingEnabled ()) {
[super otherMouseDragged: event];
return;
}
NUIE::Point position = MAS::GetViewPositionFromEvent (self, event);
Expand All @@ -144,6 +153,7 @@ - (void) otherMouseDragged : (NSEvent*) event
- (void) scrollWheel : (NSEvent*) event
{
if (!nodeEditorControl->IsInputHandlingEnabled ()) {
[super scrollWheel: event];
return;
}
NUIE::NodeEditor* nodeEditor = nodeEditorControl->GetNodeEditor ();
Expand All @@ -165,6 +175,7 @@ - (void) scrollWheel : (NSEvent*) event
- (void) magnifyWithEvent : (NSEvent*) event
{
if (!nodeEditorControl->IsInputHandlingEnabled ()) {
[super magnifyWithEvent: event];
return;
}
NUIE::Point position = MAS::GetViewPositionFromEvent (self, event);
Expand All @@ -179,6 +190,7 @@ - (void) magnifyWithEvent : (NSEvent*) event
- (void) swipeWithEvent : (NSEvent*) event
{
if (!nodeEditorControl->IsInputHandlingEnabled ()) {
[super swipeWithEvent: event];
return;
}
NUIE::NodeEditor* nodeEditor = nodeEditorControl->GetNodeEditor ();
Expand All @@ -188,6 +200,7 @@ - (void) swipeWithEvent : (NSEvent*) event
- (void) keyDown : (NSEvent*) event
{
if (!nodeEditorControl->IsInputHandlingEnabled ()) {
[super keyDown: event];
return;
}
if (!nodeEditorControl->IsMouseOverEditorWindow ()) {
Expand Down

0 comments on commit 13904fc

Please sign in to comment.