mirror of
https://github.com/barry-ran/QtScrcpy.git
synced 2025-08-03 22:28:39 +00:00
feat: adjust wheelEvent speed
This commit is contained in:
parent
3f07c3379e
commit
9efc448089
1 changed files with 4 additions and 2 deletions
|
@ -1,3 +1,5 @@
|
||||||
|
#include <cmath>
|
||||||
|
|
||||||
#include "inputconvertnormal.h"
|
#include "inputconvertnormal.h"
|
||||||
|
|
||||||
InputConvertNormal::InputConvertNormal(Controller* controller)
|
InputConvertNormal::InputConvertNormal(Controller* controller)
|
||||||
|
@ -63,10 +65,10 @@ void InputConvertNormal::wheelEvent(const QWheelEvent *from, const QSize& frameS
|
||||||
qint32 vScroll = 0;
|
qint32 vScroll = 0;
|
||||||
switch (from->orientation()) {
|
switch (from->orientation()) {
|
||||||
case Qt::Horizontal:
|
case Qt::Horizontal:
|
||||||
hScroll = from->delta();
|
hScroll = from->delta() / abs(from->delta()) * 2;
|
||||||
break;
|
break;
|
||||||
case Qt::Vertical:
|
case Qt::Vertical:
|
||||||
vScroll = from->delta();
|
vScroll = from->delta() / abs(from->delta()) * 2;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue