{
TestApplication application; // Reset all test adapter return codes
- KeyEvent event(TEST_STRING_1,"i", 99, SHIFT_MODIFIER, 0, 0, KeyEvent::Down); // set name to test, key string to i and modifier to shift
+ KeyEvent event(TEST_STRING_1,"i", 99, SHIFT_MODIFIER, 0, KeyEvent::Down); // set name to test, key string to i and modifier to shift
DALI_TEST_EQUALS(TEST_STRING_1, event.keyPressedName, TEST_LOCATION); // check key name
DALI_TEST_EQUALS("i", event.keyPressed, TEST_LOCATION); // check key string
{
TestApplication application; // Reset all test adapter return codes
- KeyEvent event("i","i", CTRL_MODIFIER, 0, 0, KeyEvent::Down);
+ KeyEvent event("i","i", 0, CTRL_MODIFIER, 0, KeyEvent::Down);
DALI_TEST_EQUALS(CTRL_MODIFIER, event.keyModifier, TEST_LOCATION); // check different modifier used
{
TestApplication application; // Reset all test adapter return codes
- KeyEvent event("i","i", ALT_MODIFIER, 0, 0, KeyEvent::Up);
+ KeyEvent event("i","i", 0, ALT_MODIFIER, 0, KeyEvent::Up);
- DALI_TEST_EQUALS(ALT_MODIFIER, event.keyModifier, TEST_LOCATION); // check different modifier used
+ DALI_TEST_EQUALS(ALT_MODIFIER, event.keyModifier, TEST_LOCATION); // check different modifier used
- DALI_TEST_EQUALS(false, event.IsCtrlModifier(), TEST_LOCATION);
+ DALI_TEST_EQUALS(false, event.IsCtrlModifier(), TEST_LOCATION);
}
// Positive fail test case for a method
{
TestApplication application; // Reset all test adapter return codes
- KeyEvent event("i","i", SHIFT_MODIFIER, 0, 0, KeyEvent::Up);
+ KeyEvent event("i","i", 0, SHIFT_MODIFIER, 0, KeyEvent::Up);
DALI_TEST_EQUALS(SHIFT_MODIFIER, event.keyModifier, TEST_LOCATION); // check different modifier used
{
TestApplication application; // Reset all test adapter return codes
- KeyEvent event("i","i", SHIFT_AND_CTRL_MODIFIER, 0, 0, KeyEvent::Down);
+ KeyEvent event("i","i", 0, SHIFT_AND_CTRL_MODIFIER, 0, KeyEvent::Down);
DALI_TEST_EQUALS(true, event.IsCtrlModifier() & event.IsShiftModifier(), TEST_LOCATION);
event.keyModifier = SHIFT_MODIFIER;
{
TestApplication application; // Reset all test adapter return codes
- KeyEvent event("i","i", SHIFT_AND_CTRL_MODIFIER, 0, 0, KeyEvent::Down);
+ KeyEvent event("i","i", 0, SHIFT_AND_CTRL_MODIFIER, 0, KeyEvent::Down);
DALI_TEST_EQUALS(true, event.IsCtrlModifier() | event.IsAltModifier(), TEST_LOCATION);
event.keyModifier = SHIFT_MODIFIER;
{
TestApplication application; // Reset all test adapter return codes
- KeyEvent event("i","i", SHIFT_AND_CTRL_MODIFIER, 0, 0, KeyEvent::Down);
+ KeyEvent event("i","i", 0, SHIFT_AND_CTRL_MODIFIER, 0, KeyEvent::Down);
DALI_TEST_EQUALS(true, event.IsCtrlModifier() | event.IsAltModifier(), TEST_LOCATION);
event.keyModifier = SHIFT_MODIFIER;
DALI_TEST_CHECK( keyEvent.keyString == std::string() );
DALI_TEST_EQUALS( keyEvent.keyCode, -1, TEST_LOCATION );
DALI_TEST_EQUALS( keyEvent.keyModifier, 0, TEST_LOCATION );
- DALI_TEST_EQUALS( keyEvent.cursorOffset, 0, TEST_LOCATION );
- DALI_TEST_EQUALS( keyEvent.numberOfChars, 0, TEST_LOCATION );
DALI_TEST_EQUALS( keyEvent.time, 0u, TEST_LOCATION );
DALI_TEST_EQUALS( keyEvent.state, Integration::KeyEvent::Down, TEST_LOCATION);
}
{
const std::string keyName("keyName");
const std::string keyString("keyString");
- const int keyModifier(134);
- const int offset(10);
- const int characters(12);
- const Integration::KeyEvent::State keyState(Integration::KeyEvent::Up);
-
- Integration::KeyEvent keyEvent(keyName, keyString, keyModifier, offset, characters, keyState);
- DALI_TEST_EQUALS( keyEvent.type, Integration::Event::Key, TEST_LOCATION );
- DALI_TEST_CHECK( keyEvent.keyName == keyName );
- DALI_TEST_CHECK( keyEvent.keyString == keyString );
- DALI_TEST_EQUALS( keyEvent.keyCode, -1, TEST_LOCATION );
- DALI_TEST_EQUALS( keyEvent.keyModifier, keyModifier, TEST_LOCATION );
- DALI_TEST_EQUALS( keyEvent.cursorOffset, offset, TEST_LOCATION );
- DALI_TEST_EQUALS( keyEvent.numberOfChars, characters, TEST_LOCATION );
- DALI_TEST_EQUALS( keyEvent.time, 0u, TEST_LOCATION );
- DALI_TEST_EQUALS( keyEvent.state, keyState, TEST_LOCATION);
- }
-
- {
- const std::string keyName("keyName");
- const std::string keyString("keyString");
- const int keyCode(1201);
- const int keyModifier(123);
- const int offset(321);
- const int characters(102);
- const Integration::KeyEvent::State keyState(Integration::KeyEvent::Up);
-
- Integration::KeyEvent keyEvent(keyName, keyString, keyCode, keyModifier, offset, characters, keyState);
- DALI_TEST_EQUALS( keyEvent.type, Integration::Event::Key, TEST_LOCATION );
- DALI_TEST_CHECK( keyEvent.keyName == keyName );
- DALI_TEST_CHECK( keyEvent.keyString == keyString );
- DALI_TEST_EQUALS( keyEvent.keyCode, keyCode, TEST_LOCATION );
- DALI_TEST_EQUALS( keyEvent.keyModifier, keyModifier, TEST_LOCATION );
- DALI_TEST_EQUALS( keyEvent.cursorOffset, offset, TEST_LOCATION );
- DALI_TEST_EQUALS( keyEvent.numberOfChars, characters, TEST_LOCATION );
- DALI_TEST_EQUALS( keyEvent.time, 0u, TEST_LOCATION );
- DALI_TEST_EQUALS( keyEvent.state, keyState, TEST_LOCATION);
- }
-
- {
- const std::string keyName("keyName");
- const std::string keyString("keyString");
const int keyCode(333);
const int keyModifier(312);
const int offset(29);
const unsigned long timeStamp(132);
const Integration::KeyEvent::State keyState(Integration::KeyEvent::Up);
- Integration::KeyEvent keyEvent(keyName, keyString, keyCode, keyModifier, offset, characters, timeStamp, keyState);
+ Integration::KeyEvent keyEvent(keyName, keyString, keyCode, keyModifier, timeStamp, keyState);
DALI_TEST_EQUALS( keyEvent.type, Integration::Event::Key, TEST_LOCATION );
DALI_TEST_CHECK( keyEvent.keyName == keyName );
DALI_TEST_CHECK( keyEvent.keyString == keyString );
DALI_TEST_EQUALS( keyEvent.keyCode, keyCode, TEST_LOCATION );
DALI_TEST_EQUALS( keyEvent.keyModifier, keyModifier, TEST_LOCATION );
- DALI_TEST_EQUALS( keyEvent.cursorOffset, offset, TEST_LOCATION );
- DALI_TEST_EQUALS( keyEvent.numberOfChars, characters, TEST_LOCATION );
DALI_TEST_EQUALS( keyEvent.time, timeStamp, TEST_LOCATION );
DALI_TEST_EQUALS( keyEvent.state, keyState, TEST_LOCATION);
}
KeyEvent();
/**
- * @deprecated Use KeyEvent(std::string keyName, std::string keyString, int keyCode, int keyModifier, int cursorOffset, int numberOfChars) constructor instead.
- *
- * Constructor
- * @param[in] keyName The name of the key pressed or command from the IMF, if later then the some following parameters will be needed.
- * @param[in] keyString A string of input characters or key pressed
- * @param[in] keyModifier The key modifier for special keys like shift and alt
- * @param[in] cursorOffset Used by the IMF keyboard and predictive text to specify a start position from the current cursor position to start deleting characters.
- * @param[in] numberOfChars Used by the IMF keyboard and predictive text to specify how many characters to delete from the cursorOffset.
- * @param[in] keyState The state of the key event.
- */
- KeyEvent(const std::string& keyName, const std::string& keyString, const int& keyModifier, const int& cursorOffset, const int& numberOfChars, const State& keyState);
-
- /**
- * @deprecated Use KeyEvent(std::string keyName, std::string keyString, int keyCode, int keyModifier, int cursorOffset, unsigned long timeStamp, int numberOfChars) constructor instead.
- *
- * Constructor
- * @param[in] keyName The name of the key pressed or command from the IMF, if later then the some following parameters will be needed.
- * @param[in] keyString A string of input characters or key pressed
- * @param[in] keyCode The unique key code for the key pressed.
- * @param[in] keyModifier The key modifier for special keys like shift and alt
- * @param[in] cursorOffset Used by the IMF keyboard and predictive text to specify a start position from the current cursor position to start deleting characters.
- * @param[in] numberOfChars Used by the IMF keyboard and predictive text to specify how many characters to delete from the cursorOffset.
- * @param[in] keyState The state of the key event.
- */
- KeyEvent(const std::string& keyName, const std::string& keyString, const int& keyCode, const int& keyModifier, const int& cursorOffset, const int& numberOfChars, const State& keyState);
-
- /**
* Constructor
* @param[in] keyName The name of the key pressed or command from the IMF, if later then the some following parameters will be needed.
* @param[in] keyString A string of input characters or key pressed
* @param[in] keyCode The unique key code for the key pressed.
* @param[in] keyModifier The key modifier for special keys like shift and alt
- * @param[in] cursorOffset Used by the IMF keyboard and predictive text to specify a start position from the current cursor position to start deleting characters.
- * @param[in] numberOfChars Used by the IMF keyboard and predictive text to specify how many characters to delete from the cursorOffset.
* @param[in] timeStamp The time (in ms) that the key event occurred.
* @param[in] keyState The state of the key event.
*/
- KeyEvent(const std::string& keyName, const std::string& keyString, const int& keyCode, const int& keyModifier, const int& cursorOffset, const int& numberOfChars, const unsigned long& timeStamp, const State& keyState);
+ KeyEvent(const std::string& keyName, const std::string& keyString, int keyCode, int keyModifier, unsigned long timeStamp, const State& keyState);
/**
* Destructor
int keyModifier;
/**
- * offset from current cursor position as provided by input framework
- */
- int cursorOffset;
-
- /**
- * number of characters from offset position to operate on as provided by input framework, usually to delete the given range.
- */
- int numberOfChars;
-
- /**
* The time (in ms) that the key event occurred.
*/
unsigned long time;
keyString(),
keyCode(-1),
keyModifier(0),
- cursorOffset(0),
- numberOfChars(0),
time(0),
state(KeyEvent::Down)
{
}
-KeyEvent::KeyEvent(const std::string& keyName, const std::string& keyString, const int& keyModifier, const int& offset, const int& characters, const State& keyState)
-: Event(Key),
- keyName(keyName),
- keyString(keyString),
- keyCode(-1),
- keyModifier(keyModifier),
- cursorOffset(offset),
- numberOfChars(characters),
- time(0),
- state(keyState)
-{
-}
-
-KeyEvent::KeyEvent(const std::string& keyName, const std::string& keyString, const int& keyCode, const int& keyModifier, const int& offset, const int& characters, const State& keyState)
-: Event(Key),
- keyName(keyName),
- keyString(keyString),
- keyCode(keyCode),
- keyModifier(keyModifier),
- cursorOffset(offset),
- numberOfChars(characters),
- time(0),
- state(keyState)
-{
-}
-
-KeyEvent::KeyEvent(const std::string& keyName, const std::string& keyString, const int& keyCode, const int& keyModifier, const int& offset, const int& characters, const unsigned long& timeStamp, const State& keyState)
+KeyEvent::KeyEvent(const std::string& keyName, const std::string& keyString, int keyCode, int keyModifier, unsigned long timeStamp, const State& keyState)
: Event(Key),
keyName(keyName),
keyString(keyString),
keyCode(keyCode),
keyModifier(keyModifier),
- cursorOffset(offset),
- numberOfChars(characters),
time(timeStamp),
state(keyState)
{
KeyEvent();
/**
- * @deprecated Use KeyEvent(std::string keyName, std::string keyString, int keyCode, int keyModifier, int cursorOffset, int numberOfChars) constructor instead.
- *
- * Constructor
- * @param[in] keyName The name of character/key pressed
- * @param[in] keyPressed The character/key pressed
- * @param[in] keyModifier The raw key code for this character
- * @param[in] cursorOffset Offset from cursor position ( Used by input framework )
- * @param[in] numberOfChars Number of characters from offset to perform actio on ( Used by input framework )
- * @param[in] keyState The state of the key event.
- */
- KeyEvent(const std::string& keyName,
- const std::string& keyPressed,
- const int& keyModifier,
- const int& cursorOffset,
- const int& numberOfChars,
- const State& keyState);
-
- /**
- * @deprecated Use KeyEvent(std::string keyName, std::string keyString, int keyCode, int keyModifier, int cursorOffset, unsigned long timeStamp, int numberOfChars) constructor instead.
- *
* Constructor
* @param[in] keyName The name of the key pressed or command from the IMF, if later then the some following parameters will be needed.
* @param[in] keyString A string of input characters or key pressed
* @param[in] keyCode The unique key code for the key pressed.
* @param[in] keyModifier The key modifier for special keys like shift and alt
- * @param[in] cursorOffset Used by the IMF keyboard and predictive text to specify a start position from the current cursor position to start deleting characters.
- * @param[in] numberOfChars Used by the IMF keyboard and predictive text to specify how many characters to delete from the cursorOffset.
- * @param[in] keyState The state of the key event.
- */
- KeyEvent(const std::string& keyName,
- const std::string& keyString,
- const int& keyCode,
- const int& keyModifier,
- const int& cursorOffset,
- const int& numberOfChars,
- const State& keyState);
-
- /**
- * Constructor
- * @param[in] keyName The name of the key pressed or command from the IMF, if later then the some following parameters will be needed.
- * @param[in] keyString A string of input characters or key pressed
- * @param[in] keyCode The unique key code for the key pressed.
- * @param[in] keyModifier The key modifier for special keys like shift and alt
- * @param[in] cursorOffset Used by the IMF keyboard and predictive text to specify a start position from the current cursor position to start deleting characters.
- * @param[in] numberOfChars Used by the IMF keyboard and predictive text to specify how many characters to delete from the cursorOffset.
* @param[in] timeStamp The time (in ms) that the key event occurred.
* @param[in] keyState The state of the key event.
*/
KeyEvent(const std::string& keyName,
const std::string& keyString,
- const int& keyCode,
- const int& keyModifier,
- const int& cursorOffset,
- const int& numberOfChars,
- const unsigned long& timeStamp,
+ int keyCode,
+ int keyModifier,
+ unsigned long timeStamp,
const State& keyState);
/**
int keyModifier;
/**
- *@copydoc Dali::KeyEvent::cursorOffset
- */
- int cursorOffset;
-
- /**
- *@copydoc Dali::KeyEvent::numberOfChars
- */
- int numberOfChars;
-
- /**
*@copydoc Dali::KeyEvent::time
*/
unsigned long time;
void KeyEventProcessor::ProcessKeyEvent(const Integration::KeyEvent& event)
{
- KeyEvent keyEvent(event.keyName, event.keyString, event.keyCode, event.keyModifier, event.cursorOffset, event.numberOfChars, static_cast<KeyEvent::State>(event.state));
+ KeyEvent keyEvent(event.keyName, event.keyString, event.keyCode, event.keyModifier, event.time, static_cast<KeyEvent::State>(event.state));
// Emit the key event signal from stage.
mStage.EmitKeyEventSignal(keyEvent);
keyPressed(""),
keyCode(KEY_INVALID_CODE),
keyModifier(0),
- cursorOffset(0),
- numberOfChars(0),
state(KeyEvent::Down)
{
}
-KeyEvent::KeyEvent(const std::string& keyName, const std::string& keyPressed, const int& keyModifier, const int& offset, const int& characters, const State& keyState)
-: keyPressedName(keyName),
- keyPressed(keyPressed),
- keyCode(KEY_INVALID_CODE),
- keyModifier(keyModifier),
- cursorOffset(offset),
- numberOfChars(characters),
- time(0),
- state(keyState)
-{
-}
-
-KeyEvent::KeyEvent(const std::string& keyName, const std::string& keyString, const int& keyCode, const int& keyModifier, const int& cursorOffset, const int& numberOfChars, const State& keyState)
-: keyPressedName(keyName),
- keyPressed(keyString),
- keyCode(keyCode),
- keyModifier(keyModifier),
- cursorOffset(cursorOffset),
- numberOfChars(numberOfChars),
- time(0),
- state(keyState)
-{
-}
-
-KeyEvent::KeyEvent(const std::string& keyName, const std::string& keyString, const int& keyCode, const int& keyModifier, const int& cursorOffset, const int& numberOfChars, const unsigned long& timeStamp, const State& keyState)
+KeyEvent::KeyEvent(const std::string& keyName, const std::string& keyString, int keyCode, int keyModifier,unsigned long timeStamp, const State& keyState)
: keyPressedName(keyName),
keyPressed(keyString),
keyCode(keyCode),
keyModifier(keyModifier),
- cursorOffset(cursorOffset),
- numberOfChars(numberOfChars),
time(timeStamp),
state(keyState)
{