KeyboardGUIPlugin.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2016 Open Source Robotics Foundation
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16 */
17 #ifndef GAZEBO_PLUGINS_KEYBOARDGUIPLUGIN_HH_
18 #define GAZEBO_PLUGINS_KEYBOARDGUIPLUGIN_HH_
19 
20 #include <memory>
21 #include <gazebo/common/Plugin.hh>
22 
23 // See: https://bugreports.qt-project.org/browse/QTBUG-22829
24 #ifndef Q_MOC_RUN
25 # include <gazebo/gui/gui.hh>
26 #endif
27 
28 namespace gazebo
29 {
30  // Forward declare private data class
31  class KeyboardGUIPluginPrivate;
32 
36  {
37  Q_OBJECT
38 
40  public: KeyboardGUIPlugin();
41 
43  public: virtual ~KeyboardGUIPlugin();
44 
47  protected: void OnKeyPress(const gazebo::common::KeyEvent &_event);
48 
53  private: bool eventFilter(QObject *_obj, QEvent *_event);
54 
57  private: std::unique_ptr<KeyboardGUIPluginPrivate> dataPtr;
58  };
59 }
60 
61 #endif
A plugin loaded within the gzclient on startup.
Definition: GuiPlugin.hh:26
Generic description of a keyboard event.
Definition: KeyEvent.hh:32
A GUI plugin that captures key strokes from gzclient GUI and publishes over gz transport topic ~/keyb...
Definition: KeyboardGUIPlugin.hh:35
#define GAZEBO_VISIBLE
Use to represent "symbol visible" if supported.
Definition: system.hh:58