1 #ifndef __DALI_KEY_EVENT_H__
2 #define __DALI_KEY_EVENT_H__
5 * Copyright (c) 2014 Samsung Electronics Co., Ltd.
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
25 #include <dali/public-api/common/dali-common.h>
31 * @brief The key event structure is used to store a key press.
33 * It facilitates processing of these key presses and passing to other
34 * libraries like Toolkit. The keyString is the actual character you
35 * might want to display while the key name is just a descriptive
36 * name. There is a key modifier which relates to keys like alt,
37 * shift and control functions are supplied to check if they have been
40 * Currently KeyEvent is also being used to relay messages from the
41 * IMF keyboard to Core. In future IMF may communicate via its own
44 struct DALI_IMPORT_API KeyEvent
49 * @brief Specifies the state of the key event.
59 * @brief Default constructor
66 * @param[in] keyName The name of the key pressed or command from the IMF, if later then the some following parameters will be needed.
67 * @param[in] keyString A string of input characters or key pressed
68 * @param[in] keyCode The unique key code for the key pressed.
69 * @param[in] keyModifier The key modifier for special keys like shift and alt
70 * @param[in] timeStamp The time (in ms) that the key event occurred.
71 * @param[in] keyState The state of the key event.
73 KeyEvent(const std::string& keyName, const std::string& keyString, int keyCode, int keyModifier, unsigned long timeStamp, const State& keyState);
81 * @brief Check to see if Shift key modifier has been supplied.
83 * @return bool true if shift modifier
85 bool IsShiftModifier() const;
88 * @brief Check to see if Ctrl (control) key modifier has been supplied.
90 * @return bool true if ctrl modifier
92 bool IsCtrlModifier() const;
95 * @brief Check to see if Alt key modifier has been supplied.
97 * @return bool true if alt modifier
99 bool IsAltModifier() const;
104 * @brief name given to the key pressed.
106 std::string keyPressedName;
109 * @brief The actual string returned that should be used for input editors.
111 std::string keyPressed;
114 * @brief Keycode for the key pressed.
119 * @brief special keys like shift, alt and control which modify the next key pressed.
124 * @brief The time (in ms) that the key event occurred.
129 * @brief State of the key event.
139 #endif // __DALI_KEY_EVENT_H__