Skip to content

Commit

Permalink
Some minor code cleanup to make things easier to read
Browse files Browse the repository at this point in the history
  • Loading branch information
zadjii-msft committed Mar 27, 2020
1 parent c0ed7ea commit f3483c2
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions src/cascadia/TerminalControl/TermControl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1186,8 +1186,9 @@ namespace winrt::Microsoft::Terminal::TerminalControl::implementation
}

// Method Description:
// - Actually handle a scrolling event, with from a mouse wheel or a touchpad scroll. Depending upon what modifier keys are
// pressed, different actions will take place.
// - Actually handle a scrolling event, with from a mouse wheel or a
// touchpad scroll. Depending upon what modifier keys are pressed,
// different actions will take place.
// * Attempts to first dispatch the mouse scroll as a VT event
// * If Ctrl+Shift are pressed, then attempts to change our opacity
// * If just Ctrl is pressed, we'll attempt to "zoom" by changing our font size
Expand All @@ -1203,12 +1204,15 @@ namespace winrt::Microsoft::Terminal::TerminalControl::implementation
{
if (_CanSendVTMouseInput())
{
// TODO this used to be
// _TrySendMouseEvent(point);
// But we don't have a PointerPoint anymore. So we're going to fake that this is only a mousewheel.
const auto terminalPosition = _GetTerminalPosition(point);
unsigned int uiButton = WM_MOUSEWHEEL;
return _terminal->SendMouseEvent(terminalPosition, uiButton, _GetPressedModifierKeys(), ::base::saturated_cast<short>(delta));
// Most mouse event handlers call
// _TrySendMouseEvent(point);
// here with a PointerPoint. However, as of #979, we don't have a
// PointerPoint to work with. So, we're just going to do a
// mousewheel event manually
return _terminal->SendMouseEvent(_GetTerminalPosition(point),
WM_MOUSEWHEEL,
_GetPressedModifierKeys(),
::base::saturated_cast<short>(delta));
}

const auto ctrlPressed = modifiers.IsCtrlPressed();
Expand Down

1 comment on commit f3483c2

@github-actions

This comment was marked as resolved.

Please sign in to comment.