trikRuntime
gamepadInterface.h
Go to the documentation of this file.
1 /* Copyright 2015 CyberTech Labs Ltd.
2  *
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  * http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License. */
14 
15 #pragma once
16 
17 #include <QtCore/QObject>
18 
19 #include "declSpec.h"
20 
21 namespace trikControl {
22 
24 class TRIKCONTROL_EXPORT GamepadInterface : public QObject
25 {
26  Q_OBJECT
27 
28 public slots:
30  virtual void reset() = 0;
31 
34  virtual bool buttonWasPressed(int buttonNumber) = 0;
35 
37  virtual bool buttonIsPressed(int buttonNumber) = 0;
38 
40  virtual bool isPadPressed(int pad) const = 0;
41 
43  virtual int padX(int pad) const = 0;
44 
46  virtual int padY(int pad) const = 0;
47 
49  virtual int wheel() const = 0;
50 
52  virtual bool isConnected() const = 0;
53 
57  virtual bool disconnect() = 0;
58 
59 
60 signals:
63  void padUp(int pad);
64 
67  void wheelEvent(int percent);
68 
73  void pad(int pad, int x, int y);
74 
78  void button(int button, int pressed);
79 
82  void custom(const QString &s);
83 
86  void connected();
87 
90  void disconnected();
91 };
92 
93 }
94 
95 Q_DECLARE_METATYPE(trikControl::GamepadInterface *)
#define TRIKCONTROL_EXPORT
Definition: declSpec.h:23
Definition: trikCommunicator.h:27
Remote control of a robot via Android gamepad.
Definition: gamepadInterface.h:24
var x
Definition: file-test.js:2
var y
Definition: file-test.js:5