mirror of
https://github.com/opentx/opentx.git
synced 2025-07-15 12:25:12 +03:00
* Fix for issue with trackpad & mouse wheel: Small movements up or down send delta=0, causing always events in the same direction. * Changed keys to X,C
This commit is contained in:
parent
bab5fc339e
commit
d9981b25d9
2 changed files with 12 additions and 3 deletions
|
@ -70,7 +70,9 @@ void SimulatorDialog::updateDebugOutput()
|
||||||
|
|
||||||
void SimulatorDialog::wheelEvent (QWheelEvent *event)
|
void SimulatorDialog::wheelEvent (QWheelEvent *event)
|
||||||
{
|
{
|
||||||
simulator->wheelEvent(event->delta() > 0 ? 1 : -1);
|
if ( event->delta() != 0) {
|
||||||
|
simulator->wheelEvent(event->delta() > 0 ? 1 : -1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SimulatorDialog::SimulatorDialog(QWidget * parent, SimulatorInterface *simulator, unsigned int flags):
|
SimulatorDialog::SimulatorDialog(QWidget * parent, SimulatorInterface *simulator, unsigned int flags):
|
||||||
|
@ -220,6 +222,13 @@ void SimulatorDialog::keyPressEvent (QKeyEvent *event)
|
||||||
case Qt::Key_PageUp:
|
case Qt::Key_PageUp:
|
||||||
buttonPressed = event->key();
|
buttonPressed = event->key();
|
||||||
break;
|
break;
|
||||||
|
case Qt::Key_X:
|
||||||
|
simulator->wheelEvent(-1);
|
||||||
|
break;
|
||||||
|
case Qt::Key_C:
|
||||||
|
simulator->wheelEvent(1);
|
||||||
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -360,11 +360,11 @@ long Open9xSim::onTimeout(FXObject*, FXSelector, void*)
|
||||||
|
|
||||||
#if defined(ROTARY_ENCODER_NAVIGATION)
|
#if defined(ROTARY_ENCODER_NAVIGATION)
|
||||||
static bool rotencAction = false;
|
static bool rotencAction = false;
|
||||||
if (getApp()->getKeyState(KEY_X)) {
|
if (getApp()->getKeyState(KEY_C)) {
|
||||||
if (!rotencAction) ROTARY_ENCODER_NAVIGATION_VALUE += ROTARY_ENCODER_GRANULARITY;
|
if (!rotencAction) ROTARY_ENCODER_NAVIGATION_VALUE += ROTARY_ENCODER_GRANULARITY;
|
||||||
rotencAction = true;
|
rotencAction = true;
|
||||||
}
|
}
|
||||||
else if (getApp()->getKeyState(KEY_W) || getApp()->getKeyState(KEY_Z)) {
|
else if (getApp()->getKeyState(KEY_X)) {
|
||||||
if (!rotencAction) ROTARY_ENCODER_NAVIGATION_VALUE -= ROTARY_ENCODER_GRANULARITY;
|
if (!rotencAction) ROTARY_ENCODER_NAVIGATION_VALUE -= ROTARY_ENCODER_GRANULARITY;
|
||||||
rotencAction = true;
|
rotencAction = true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue