mirror of https://github.com/jetkvm/kvm.git
Update hid_mouse_absolute.go
Eliminate adjustment of wheelY value. This is now done completely in mouseWheelHandler() in WebRTCVideo.tsx.
This commit is contained in:
parent
340babac24
commit
5411424d7c
|
@ -107,24 +107,11 @@ func (u *UsbGadget) AbsMouseWheelReport(wheelY int8) error {
|
|||
u.absMouseLock.Lock()
|
||||
defer u.absMouseLock.Unlock()
|
||||
|
||||
// Accumulate the wheelY value
|
||||
u.absMouseAccumulatedWheelY += float64(wheelY) / 8.0
|
||||
|
||||
// Only send a report if the accumulated value is significant
|
||||
if abs(u.absMouseAccumulatedWheelY) < 1.0 {
|
||||
return nil
|
||||
}
|
||||
|
||||
scaledWheelY := int8(u.absMouseAccumulatedWheelY)
|
||||
|
||||
err := u.absMouseWriteHidFile([]byte{
|
||||
2, // Report ID 2
|
||||
byte(scaledWheelY), // Scaled Wheel Y (signed)
|
||||
2, // Report ID 2
|
||||
byte(wheelY), // Wheel Y (signed)
|
||||
})
|
||||
|
||||
// Reset the accumulator, keeping any remainder
|
||||
u.absMouseAccumulatedWheelY -= float64(scaledWheelY)
|
||||
|
||||
u.resetUserInputTime()
|
||||
return err
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue