mirror of
https://gitlab.com/pholy/OSCAR-code.git
synced 2025-04-06 19:20:45 +00:00
Added up/down key to zoom, plus ctrl accelerator
This commit is contained in:
parent
e72980de11
commit
6d00f59ec2
@ -365,11 +365,24 @@ void gGraphWindow::mouseReleaseEvent(QMouseEvent * event)
|
||||
void gGraphWindow::keyPressEvent(QKeyEvent * event)
|
||||
{
|
||||
bool moved=false;
|
||||
int accel=1;
|
||||
if (event->key()==Qt::Key_Left) {
|
||||
MoveX(40);
|
||||
if (event->modifiers() & Qt::ControlModifier) accel=4;
|
||||
MoveX(40*accel);
|
||||
moved=true;
|
||||
} else if (event->key()==Qt::Key_Right) {
|
||||
MoveX(-40);
|
||||
if (event->modifiers() & Qt::ControlModifier) accel=4;
|
||||
MoveX(-40*accel);
|
||||
moved=true;
|
||||
} else if (event->key()==Qt::Key_Up) {
|
||||
double zoom_fact=2;
|
||||
if (event->modifiers() & Qt::ControlModifier) zoom_fact=5;
|
||||
ZoomX(zoom_fact,0);
|
||||
moved=true;
|
||||
} else if (event->key()==Qt::Key_Down) {
|
||||
double zoom_fact=.5;
|
||||
if (event->modifiers() & Qt::ControlModifier) zoom_fact=.2;
|
||||
ZoomX(zoom_fact,0);
|
||||
moved=true;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user