author | František Kučera <franta-hg@frantovo.cz> |
Thu, 07 Mar 2019 16:20:51 +0100 | |
branch | v_0 |
changeset 6 | 49560660d230 |
parent 5 | 6ba51911d539 |
child 7 | b6c0e1574a8b |
permissions | -rw-r--r-- |
5 | 1 |
/** |
2 |
* Spacenav Demo Qt |
|
3 |
* Copyright © 2019 František Kučera (Frantovo.cz, GlobalCode.info) |
|
4 |
* |
|
5 |
* This program is free software: you can redistribute it and/or modify |
|
6 |
* it under the terms of the GNU General Public License as published by |
|
7 |
* the Free Software Foundation, either version 3 of the License, or |
|
8 |
* (at your option) any later version. |
|
9 |
* |
|
10 |
* This program is distributed in the hope that it will be useful, |
|
11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
13 |
* GNU General Public License for more details. |
|
14 |
* |
|
15 |
* You should have received a copy of the GNU General Public License |
|
16 |
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
17 |
*/ |
|
18 |
||
19 |
#include "SpacenavWindow.h" |
|
20 |
||
21 |
SpacenavWindow::SpacenavWindow() { |
|
22 |
widget.setupUi(this); |
|
6
49560660d230
emit MotionEvent and ButtonEvent + display button status
František Kučera <franta-hg@frantovo.cz>
parents:
5
diff
changeset
|
23 |
resize(640, 480); |
49560660d230
emit MotionEvent and ButtonEvent + display button status
František Kučera <franta-hg@frantovo.cz>
parents:
5
diff
changeset
|
24 |
setWindowTitle("Spacenav Demo"); |
5 | 25 |
} |
26 |
||
27 |
SpacenavWindow::~SpacenavWindow() { |
|
28 |
} |
|
29 |
||
6
49560660d230
emit MotionEvent and ButtonEvent + display button status
František Kučera <franta-hg@frantovo.cz>
parents:
5
diff
changeset
|
30 |
void SpacenavWindow::spacenavMotionEvent(SpacenavWrapper::Event::MotionEvent e) { |
49560660d230
emit MotionEvent and ButtonEvent + display button status
František Kučera <franta-hg@frantovo.cz>
parents:
5
diff
changeset
|
31 |
setWindowTitle("m event!"); |
5 | 32 |
} |
6
49560660d230
emit MotionEvent and ButtonEvent + display button status
František Kučera <franta-hg@frantovo.cz>
parents:
5
diff
changeset
|
33 |
|
49560660d230
emit MotionEvent and ButtonEvent + display button status
František Kučera <franta-hg@frantovo.cz>
parents:
5
diff
changeset
|
34 |
void SpacenavWindow::spacenavButtonEvent(SpacenavWrapper::Event::ButtonEvent e) { |
49560660d230
emit MotionEvent and ButtonEvent + display button status
František Kučera <franta-hg@frantovo.cz>
parents:
5
diff
changeset
|
35 |
setWindowTitle("b event!"); |
49560660d230
emit MotionEvent and ButtonEvent + display button status
František Kučera <franta-hg@frantovo.cz>
parents:
5
diff
changeset
|
36 |
if (e.number == 0) widget.button0->setChecked(e.pressed); |
49560660d230
emit MotionEvent and ButtonEvent + display button status
František Kučera <franta-hg@frantovo.cz>
parents:
5
diff
changeset
|
37 |
if (e.number == 1) widget.button1->setChecked(e.pressed); |
49560660d230
emit MotionEvent and ButtonEvent + display button status
František Kučera <franta-hg@frantovo.cz>
parents:
5
diff
changeset
|
38 |
} |