KeyEvent.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2012-2015 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 _KEYEVENT_HH_
18 #define _KEYEVENT_HH_
19 
20 #include <string>
21 #include "gazebo/util/system.hh"
22 
23 namespace gazebo
24 {
25  namespace common
26  {
29 
33  {
35  public: KeyEvent() : type(NO_EVENT), key(0), text(""), control(false),
36  shift(false), alt(false) {}
37 
39  public: enum EventType {NO_EVENT, PRESS, RELEASE};
40 
42  public: EventType type;
43 
45  public: int key;
46 
48  public: std::string text;
49 
51  public: bool control;
52 
54  public: bool shift;
55 
57  public: bool alt;
58  };
60  }
61 }
62 #endif
KeyEvent()
Constructor.
Definition: KeyEvent.hh:35
std::string text
Formatted string of the key pressed (could be uppercase).
Definition: KeyEvent.hh:48
Generic description of a keyboard event.
Definition: KeyEvent.hh:32
EventType type
Event type.
Definition: KeyEvent.hh:42
EventType
Key event types enumeration.
Definition: KeyEvent.hh:39
#define GZ_COMMON_VISIBLE
Definition: system.hh:91
bool alt
Was alt held during this key event?
Definition: KeyEvent.hh:57
bool shift
Was shift held during this key event?
Definition: KeyEvent.hh:54
int key
The raw value of the key pressed.
Definition: KeyEvent.hh:45
bool control
Was control held during this key event?
Definition: KeyEvent.hh:51