KeyEvent.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2012 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_KEYEVENT_HH_
18 #define _GAZEBO_KEYEVENT_HH_
19 
20 #include <string>
21 #include "gazebo/util/system.hh"
22 
23 namespace gazebo
24 {
25  namespace common
26  {
29 
32  class GZ_COMMON_VISIBLE KeyEvent
33  {
35  public: KeyEvent();
36 
38  public: enum EventType {NO_EVENT, PRESS, RELEASE};
39 
41  public: EventType type;
42 
44  public: int key;
45 
47  public: std::string text;
48 
50  public: bool control;
51 
53  public: bool shift;
54 
56  public: bool alt;
57  };
59  }
60 }
61 #endif
EventType type
Event type.
Definition: KeyEvent.hh:41
bool alt
Was alt held during this key event?
Definition: KeyEvent.hh:56
Forward declarations for the common classes.
Definition: Animation.hh:26
Generic description of a keyboard event.
Definition: KeyEvent.hh:32
int key
The raw value of the key pressed.
Definition: KeyEvent.hh:44
bool control
Was control held during this key event?
Definition: KeyEvent.hh:50
std::string text
Formatted string of the key pressed (could be uppercase).
Definition: KeyEvent.hh:47
bool shift
Was shift held during this key event?
Definition: KeyEvent.hh:53
EventType
Key event types enumeration.
Definition: KeyEvent.hh:38