Tizen Native API
Dali::KeyEvent Struct Reference

The key event structure is used to store a key press. More...

Public Types

enum  State
 Specifies the state of the key event. More...

Public Member Functions

 KeyEvent ()
 Default constructor.
 KeyEvent (const std::string &keyName, const std::string &keyString, int keyCode, int keyModifier, unsigned long timeStamp, const State &keyState)
 Constructor.
 ~KeyEvent ()
 Destructor.
bool IsShiftModifier () const
 Check to see if Shift key modifier has been supplied.
bool IsCtrlModifier () const
 Check to see if Ctrl (control) key modifier has been supplied.
bool IsAltModifier () const
 Check to see if Alt key modifier has been supplied.

Public Attributes

std::string keyPressedName
 name given to the key pressed.
std::string keyPressed
 The actual string returned that should be used for input editors.
int keyCode
 Keycode for the key pressed.
int keyModifier
 special keys like shift, alt and control which modify the next key pressed.
unsigned long time
 The time (in ms) that the key event occurred.
State state
 State of the key event.

Detailed Description

The key event structure is used to store a key press.

It facilitates processing of these key presses and passing to other libraries like Toolkit. The keyString is the actual character you might want to display while the key name is just a descriptive name. There is a key modifier which relates to keys like alt, shift and control functions are supplied to check if they have been pressed.

Currently KeyEvent is also being used to relay messages from the IMF(Input Method Framework) keyboard to the internal core. In future IMF may communicate via its own module.

Since :
2.4

Member Enumeration Documentation

Specifies the state of the key event.

Since :
2.4
Enumerator:
Down 

Key down.

Since :
2.4
Up 

Key up.

Since :
2.4

Constructor & Destructor Documentation

Default constructor.

Since :
2.4
Dali::KeyEvent::KeyEvent ( const std::string &  keyName,
const std::string &  keyString,
int  keyCode,
int  keyModifier,
unsigned long  timeStamp,
const State keyState 
)

Constructor.

Since :
2.4
Parameters:
[in]keyNameThe name of the key pressed or command from the IMF, if later then the some following parameters will be needed.
[in]keyStringA string of input characters or key pressed
[in]keyCodeThe unique key code for the key pressed.
[in]keyModifierThe key modifier for special keys like shift and alt
[in]timeStampThe time (in ms) that the key event occurred.
[in]keyStateThe state of the key event.

Destructor.

Since :
2.4

Member Function Documentation

Check to see if Alt key modifier has been supplied.

Since :
2.4
Returns:
True if alt modifier

Check to see if Ctrl (control) key modifier has been supplied.

Since :
2.4
Returns:
True if ctrl modifier

Check to see if Shift key modifier has been supplied.

Since :
2.4
Returns:
True if shift modifier

Member Data Documentation

Keycode for the key pressed.

We recommend not to use this key code value directly because its meaning might be changed in the future. Currently, it means a platform-specific key code. You need to use IsKey() to know what a key event means instead of direct comparison of key code value.

State of the key event.

See also:
State