Skip to content

Enable alternate scroll mode by default #16535

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/terminal/input/mouseInput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -334,11 +334,6 @@ TerminalInput::OutputType TerminalInput::HandleMouse(const til::point position,
_mouseInputState.accumulatedDelta = 0;
}

if (ShouldSendAlternateScroll(button, delta))
{
return _makeAlternateScrollOutput(delta);
}

if (IsTrackingMouseInput())
{
// isHover is only true for WM_MOUSEMOVE events
Expand Down Expand Up @@ -392,6 +387,11 @@ TerminalInput::OutputType TerminalInput::HandleMouse(const til::point position,
}
}

if (ShouldSendAlternateScroll(button, delta))
{
return _makeAlternateScrollOutput(delta);
}

return {};
}

Expand Down
2 changes: 1 addition & 1 deletion src/terminal/input/terminalInput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ bool TerminalInput::GetInputMode(const Mode mode) const noexcept

void TerminalInput::ResetInputModes() noexcept
{
_inputMode = { Mode::Ansi, Mode::AutoRepeat };
_inputMode = { Mode::Ansi, Mode::AutoRepeat, Mode::AlternateScroll };
_mouseInputState.lastPos = { -1, -1 };
_mouseInputState.lastButton = 0;
}
Expand Down
2 changes: 1 addition & 1 deletion src/terminal/input/terminalInput.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ namespace Microsoft::Console::VirtualTerminal

std::optional<WORD> _lastVirtualKeyCode;

til::enumset<Mode> _inputMode{ Mode::Ansi, Mode::AutoRepeat };
til::enumset<Mode> _inputMode{ Mode::Ansi, Mode::AutoRepeat, Mode::AlternateScroll };
bool _forceDisableWin32InputMode{ false };

[[nodiscard]] OutputType _makeCharOutput(wchar_t ch);
Expand Down