[Qt-interest] key event not responding

ami guru dosto.walla at gmail.com
Sun Mar 8 04:35:15 CET 2009


Hello forum,


I have a created a globject (subclass of QGLWidget ) inside the mainwindow
and i want to implement a keyboeard event to move light sources.

i have reimplemented  the keyPressEvent() but it is not responding upon
keypress.


That is the following code for that:


**********************************************

void GLWidget::keyPressEvent(QKeyEvent *event)
{

  qDebug() << "event caught" << endl;

  switch(event->key())
    {
    case Qt::Key_Left:
      yKeyRot -= 5.0f;
      break;
    case Qt::Key_Right:
      yKeyRot += 5.0f;
      break;
    case Qt::Key_Up:
      xKeyRot -= 5.0f;
      break;
    case Qt::Key_Down:
      xKeyRot += 5.0f;
      break;
    case Qt::Key_Space:

    defualt:
      break;
    }
  updateGL();
}





*************************************************


Any hint ?


Regards
Sajjad
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090308/408aba9d/attachment.html 


More information about the Qt-interest-old mailing list