mirror of
https://github.com/moonlight-stream/moonlight-chrome.git
synced 2025-08-17 00:26:56 +00:00
Add high resolution scrolling support
This commit is contained in:
parent
7d9229359a
commit
3764f7dae4
17
input.cpp
17
input.cpp
@ -116,6 +116,12 @@ void MoonlightInstance::ReportMouseMovement() {
|
||||
LiSendMouseMoveEvent(m_MouseDeltaX, m_MouseDeltaY);
|
||||
m_MouseDeltaX = m_MouseDeltaY = 0;
|
||||
}
|
||||
if (m_AccumulatedTicks != 0) {
|
||||
// We can have fractional ticks here, so multiply by WHEEL_DELTA
|
||||
// to get actual scroll distance and use the high-res variant.
|
||||
LiSendHighResScrollEvent(m_AccumulatedTicks * 120);
|
||||
m_AccumulatedTicks = 0;
|
||||
}
|
||||
}
|
||||
|
||||
bool MoonlightInstance::HandleInputEvent(const pp::InputEvent& event) {
|
||||
@ -163,8 +169,6 @@ bool MoonlightInstance::HandleInputEvent(const pp::InputEvent& event) {
|
||||
}
|
||||
|
||||
case PP_INPUTEVENT_TYPE_WHEEL: {
|
||||
signed char fullTicks;
|
||||
|
||||
if (!m_MouseLocked) {
|
||||
return false;
|
||||
}
|
||||
@ -173,15 +177,6 @@ bool MoonlightInstance::HandleInputEvent(const pp::InputEvent& event) {
|
||||
|
||||
// Accumulate the current tick value
|
||||
m_AccumulatedTicks += wheelEvent.GetTicks().y();
|
||||
|
||||
// Compute the number of full ticks
|
||||
fullTicks = (signed char) m_AccumulatedTicks;
|
||||
|
||||
// Send a scroll event if we've completed a full tick
|
||||
if (fullTicks != 0) {
|
||||
LiSendScrollEvent(fullTicks);
|
||||
m_AccumulatedTicks -= fullTicks;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit 12eebe0039ca67d4b83080fba94f6932909908a4
|
||||
Subproject commit 6eb17a8e73349f24309d86f81812dc8869bd54c1
|
Loading…
x
Reference in New Issue
Block a user