Tizen Native API  6.5
Dali::KeyEvent Struct Reference

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

Public Types

enum  State
 Enumeration for specifying the state of the key event. More...

Public Member Functions

 KeyEvent ()
 Default constructor.
 KeyEvent (const std::string &keyName, const std::string &keyString, int32_t keyCode, int32_t keyModifier, unsigned long timeStamp, const State &keyState)
 Constructor.
 KeyEvent (const KeyEvent &rhs)
 Copy constructor.
KeyEventoperator= (const KeyEvent &rhs)
 Assignment operator.
 ~KeyEvent ()
 Destructor.
bool IsShiftModifier () const
 Checks to see if Shift key modifier has been supplied.
bool IsCtrlModifier () const
 Checks to see if Ctrl (control) key modifier has been supplied.
bool IsAltModifier () const
 Checks to see if Alt key modifier has been supplied.
std::string GetCompose () const
 Get the key compose string.
std::string GetDeviceName () const
 Get the device name the key event originated from.
Device::Class::Type GetDeviceClass () const
 Get the device class the key event originated from.
Device::Subclass::Type GetDeviceSubclass () const
 Get the device subclass the key event originated from.

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.
int32_t keyCode
 Keycode for the key pressed.
int32_t 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, DALi version 1.0.0

Member Enumeration Documentation

Enumeration for specifying the state of the key event.

Since:
2.4, DALi version 1.0.0
Enumerator:
Down 

Key down.

Since:
2.4, DALi version 1.0.0
Up 

Key up.

Since:
2.4, DALi version 1.0.0

Constructor & Destructor Documentation

Default constructor.

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

Constructor.

Since:
2.4, DALi version 1.0.0
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

Copy constructor.

Since:
4.0, DALi version 1.2.36
Parameters:
[in]rhsA reference to the copied handle

Destructor.

Since:
2.4, DALi version 1.0.0

Member Function Documentation

std::string Dali::KeyEvent::GetCompose ( ) const

Get the key compose string.

Since:
5.0, DALi version 1.3.22
Returns:
The compose string

Get the device class the key event originated from.

The device class type is classification type of the input device of event received

Since:
4.0, DALi version 1.2.60
Returns:
The type of the device class
std::string Dali::KeyEvent::GetDeviceName ( ) const

Get the device name the key event originated from.

Since:
4.0, DALi version 1.2.60
Returns:
The device name

Get the device subclass the key event originated from.

The device subclass type is subclassification type of the input device of event received.

Since:
4.0, DALi version 1.2.60
Returns:
The type of the device subclass

Checks to see if Alt key modifier has been supplied.

Since:
2.4, DALi version 1.0.0
Returns:
True if alt modifier

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

Since:
2.4, DALi version 1.0.0
Returns:
True if ctrl modifier

Checks to see if Shift key modifier has been supplied.

Since:
2.4, DALi version 1.0.0
Returns:
True if shift modifier
KeyEvent& Dali::KeyEvent::operator= ( const KeyEvent rhs)

Assignment operator.

Since:
4.0, DALi version 1.2.36
Parameters:
[in]rhsA reference to the copied handle
Returns:
A reference to this

Member Data Documentation

Keycode for the key pressed.

Remarks:
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