Skip to content

Commit

Permalink
cleanup switch statement
Browse files Browse the repository at this point in the history
  • Loading branch information
tomlm committed Oct 30, 2024
1 parent 32f020e commit b38f9cd
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions src/Consolonia.PlatformSupport/WindowsConsole.cs
Original file line number Diff line number Diff line change
Expand Up @@ -172,17 +172,12 @@ private bool HandleMouseInput(WindowsConsole.MouseEventRecord mouseEvent)
case WindowsConsole.EventFlags.MouseMoved:
eventType = RawPointerEventType.Move;
break;
case WindowsConsole.EventFlags.MouseMoved | WindowsConsole.EventFlags.DoubleClick:
RaiseMouseEvent(RawPointerEventType.LeftButtonDown, point, null, inputModifiers);
RaiseMouseEvent(RawPointerEventType.Move, point, null, inputModifiers);
return false;
default:
if (mouseEvent.EventFlags == (WindowsConsole.EventFlags.MouseMoved | WindowsConsole.EventFlags.DoubleClick))
{
RaiseMouseEvent(RawPointerEventType.LeftButtonDown, point, null, inputModifiers);
RaiseMouseEvent(RawPointerEventType.Move, point, null, inputModifiers);
return false;
}
else
{
throw new InvalidOperationException(mouseEvent.EventFlags.ToString());
}
throw new InvalidOperationException(mouseEvent.EventFlags.ToString());
}

for (short i = 0; i < repeat; i++)
Expand Down

0 comments on commit b38f9cd

Please sign in to comment.