Commit 63217bed authored by Jule Marcoueille's avatar Jule Marcoueille

Ajout d'un facteur de scrolling en combinaison avec la touche Ctrl

(pour l'instant en static int mais pourra être parametrable facilement)
parent 6f41b7eb
......@@ -636,30 +636,34 @@ void Render_opengl::wheelEvent(QWheelEvent * event){
void Render_opengl::keyPressEvent(QKeyEvent * event){
int ctrl_factor = 1;
if (event->modifiers() == Qt::CTRL) ctrl_factor *= _ctrl_scroll_factor;
switch (event->key()){
case Qt::Key_Left:
/*
* Key 'left' pressed.
*/
change_translate(-1);
change_translate(-1*ctrl_factor);
break;
case Qt::Key_Right:
/*
* Key 'right' pressed.
*/
change_translate(1);
change_translate(1*ctrl_factor);
break;
case Qt::Key_Up:
/*
* Key 'up' pressed.
*/
change_translate_y(1);
change_translate_y(1*ctrl_factor);
break;
case Qt::Key_Down:
/*
* Key 'down' pressed.
*/
change_translate_y(-1);
change_translate_y(-1*ctrl_factor);
break;
default:
/*
......
......@@ -149,6 +149,11 @@ class Render_opengl : public QGLWidget, public Render
* \brief Define the minimum width and height to draw the selection rectangle (avoid bas manipulations).
*/
Element_pos _minimum_distance_for_selection;
/*!
* \brief Define the scrolling factor when CTRL key is pressed.
*/
static const int _ctrl_scroll_factor = 10;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment