Skip to content

Commit

Permalink
Updated GUI
Browse files Browse the repository at this point in the history
- added keyPress control
  • Loading branch information
proydakov committed Jul 30, 2011
1 parent 1a50246 commit d6a80a1
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
23 changes: 23 additions & 0 deletions v_joy_qt_gui.cpp
Expand Up @@ -162,6 +162,29 @@ void VJoyQtGUI::slotBallChanged(int id, int stateX, int stateY)

}

void VJoyQtGUI::keyPressEvent(QKeyEvent *event)
{
event->accept();
switch(event->key()) {
case Qt::Key_S:
scanDevices();
break;
case Qt::Key_C:
connectToDevices();
break;
case Qt::Key_D:
disconnectFromDevices();
break;
case Qt::Key_Escape:
close();
break;
default:
event->ignore();
break;
}
QMainWindow::keyPressEvent(event);
}

void VJoyQtGUI::setJoystickInfoVisible(bool visible)
{
if(visible) {
Expand Down
3 changes: 3 additions & 0 deletions v_joy_qt_gui.h
Expand Up @@ -26,6 +26,7 @@
#define __V_VIDEO_SERVER_

#include <QMainWindow>
#include <QKeyEvent>
#include <QVector>

namespace Ui
Expand Down Expand Up @@ -55,6 +56,8 @@ private slots:
void slotBallChanged(int id, int stateX, int stateY);

private:
void keyPressEvent(QKeyEvent *event);

void setJoystickInfoVisible(bool visible);
void setDeviceControlVisible(bool visible);

Expand Down

0 comments on commit d6a80a1

Please sign in to comment.