hold shift for faster key movement
This commit is contained in:
parent
539a2325e6
commit
072d485ab9
@ -186,36 +186,40 @@ void ScreenOverlay::keyPressEvent(QKeyEvent *e) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int modifier = 1;
|
||||||
|
if(e->modifiers() == Qt::ShiftModifier) modifier = 10;
|
||||||
|
|
||||||
switch (movementPattern()) {
|
switch (movementPattern()) {
|
||||||
case MP_JKL:
|
case MP_JKL:
|
||||||
if (e->key() == Qt::Key_J)
|
if (e->key() == Qt::Key_J)
|
||||||
moveMouseBy(QPoint(-1, 0), selectActive);
|
moveMouseBy(QPoint(-1 * modifier, 0), selectActive);
|
||||||
else if (e->key() == Qt::Key_K)
|
else if (e->key() == Qt::Key_K)
|
||||||
moveMouseBy(QPoint(0, 1), selectActive);
|
moveMouseBy(QPoint(0, 1 * modifier), selectActive);
|
||||||
else if (e->key() == Qt::Key_L)
|
else if (e->key() == Qt::Key_L)
|
||||||
moveMouseBy(QPoint(0, -1), selectActive);
|
moveMouseBy(QPoint(0, -1 * modifier), selectActive);
|
||||||
else if (e->key() == Qt::Key_Semicolon)
|
else if (e->key() == Qt::Key_Semicolon)
|
||||||
moveMouseBy(QPoint(1, 0), selectActive);
|
moveMouseBy(QPoint(1 * modifier, 0), selectActive);
|
||||||
break;
|
break;
|
||||||
case MP_HJKL:
|
case MP_HJKL:
|
||||||
if (e->key() == Qt::Key_H)
|
if (e->key() == Qt::Key_H)
|
||||||
moveMouseBy(QPoint(-1, 0), selectActive);
|
moveMouseBy(QPoint(-1 * modifier, 0), selectActive);
|
||||||
else if (e->key() == Qt::Key_J)
|
else if (e->key() == Qt::Key_J)
|
||||||
moveMouseBy(QPoint(0, 1), selectActive);
|
moveMouseBy(QPoint(0, 1 * modifier), selectActive);
|
||||||
else if (e->key() == Qt::Key_K)
|
else if (e->key() == Qt::Key_K)
|
||||||
moveMouseBy(QPoint(0, -1), selectActive);
|
moveMouseBy(QPoint(0, -1 * modifier), selectActive);
|
||||||
else if (e->key() == Qt::Key_L)
|
else if (e->key() == Qt::Key_L)
|
||||||
moveMouseBy(QPoint(1, 0), selectActive);
|
moveMouseBy(QPoint(1 * modifier, 0), selectActive);
|
||||||
break;
|
break;
|
||||||
case MP_ARROWS:
|
case MP_ARROWS:
|
||||||
if (e->key() == Qt::Key_Left)
|
if (e->key() == Qt::Key_Left)
|
||||||
moveMouseBy(QPoint(-1, 0), selectActive);
|
moveMouseBy(QPoint(-1 * modifier, 0), selectActive);
|
||||||
else if (e->key() == Qt::Key_Down)
|
else if (e->key() == Qt::Key_Down)
|
||||||
moveMouseBy(QPoint(0, 1), selectActive);
|
moveMouseBy(QPoint(0, 1 * modifier), selectActive);
|
||||||
else if (e->key() == Qt::Key_Up)
|
else if (e->key() == Qt::Key_Up)
|
||||||
moveMouseBy(QPoint(0, -1), selectActive);
|
moveMouseBy(QPoint(0, -1 * modifier), selectActive);
|
||||||
else if (e->key() == Qt::Key_Right)
|
else if (e->key() == Qt::Key_Right)
|
||||||
moveMouseBy(QPoint(1, 0), selectActive);
|
moveMouseBy(QPoint(1 * modifier, 0), selectActive);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
e->accept();
|
e->accept();
|
||||||
|
Loading…
Reference in New Issue
Block a user