Ignition Common

API Reference

3.9.0
KeyEvent.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 IGNITION_COMMON_KEYEVENT_HH_
18 #define IGNITION_COMMON_KEYEVENT_HH_
19 
20 #include <memory>
21 #include <string>
22 
23 #include <ignition/common/events/Export.hh>
25 
26 namespace ignition
27 {
28  namespace common
29  {
30  // Forward declare private data class
31  class KeyEventPrivate;
32 
35  class IGNITION_COMMON_EVENTS_VISIBLE KeyEvent
36  {
38  public: enum EventType {NO_EVENT, PRESS, RELEASE};
39 
41  public: KeyEvent();
42 
44  public: ~KeyEvent();
45 
48  public: EventType Type() const;
49 
52  public: void SetType(const EventType _type);
53 
56  public: int Key() const;
57 
60  public: void SetKey(const int _key);
61 
65  public: std::string Text() const;
66 
69  public: void SetText(const std::string &_text);
70 
73  public: bool Control() const;
74 
77  public: void SetControl(const bool _control);
78 
81  public: bool Shift() const;
82 
85  public: void SetShift(const bool _shift);
86 
89  public: bool Alt() const;
90 
93  public: void SetAlt(const bool _alt);
94 
97  private: std::unique_ptr<KeyEventPrivate> dataPtr;
99  };
100  }
101 }
102 #endif
Generic description of a keyboard event.
Definition: KeyEvent.hh:35
#define IGN_COMMON_WARN_RESUME__DLL_INTERFACE_MISSING
Definition: SuppressWarning.hh:67
STL class.
EventType
Key event types enumeration.
Definition: KeyEvent.hh:38
Forward declarations for the common classes.
#define IGN_COMMON_WARN_IGNORE__DLL_INTERFACE_MISSING
Microsoft Visual Studio does not automatically export the interface information for member variables ...
Definition: SuppressWarning.hh:64