END_TEST;
}
+
+int UtcDaliKeyEventSetRepeat(void)
+{
+ TestApplication application;
+
+ Dali::KeyEvent event = DevelKeyEvent::New(TEST_STRING_1, "I", "i", 99, SHIFT_MODIFIER, 0lu, KeyEvent::DOWN, "", "", Device::Class::NONE, Device::Subclass::NONE);
+
+ DALI_TEST_EQUALS(false, event.IsRepeat(), TEST_LOCATION);
+
+ DevelKeyEvent::SetRepeat(event, true);
+ DALI_TEST_EQUALS(true, event.IsRepeat(), TEST_LOCATION);
+
+ END_TEST;
+}
\ No newline at end of file
GetImplementation(keyEvent).SetState(state);\r
}\r
\r
+void SetRepeat(KeyEvent keyEvent, const bool repeat)\r
+{\r
+ GetImplementation(keyEvent).SetRepeat(repeat);\r
+}\r
+\r
} // namespace DevelKeyEvent\r
\r
} // namespace Dali\r
*/\r
DALI_CORE_API void SetState(KeyEvent keyEvent, const KeyEvent::State& state);\r
\r
+/**\r
+ * @brief Set whether to repeat key event.\r
+ *\r
+ * @SINCE_2_2.44\r
+ * @param[in] keyEvent The instance of KeyEvent.\r
+ * @param[in] repeat Whether the key event is a repeating key.\r
+ */\r
+DALI_CORE_API void SetRepeat(KeyEvent keyEvent, const bool repeat);\r
+\r
} // namespace DevelKeyEvent\r
\r
} // namespace Dali\r
compose(""),
deviceName(""),
deviceClass(Device::Class::NONE),
- deviceSubclass(Device::Subclass::NONE)
+ deviceSubclass(Device::Subclass::NONE),
+ isRepeat(false)
{
}
compose(compose),
deviceName(deviceName),
deviceClass(deviceClass),
- deviceSubclass(deviceSubclass)
+ deviceSubclass(deviceSubclass),
+ isRepeat(false)
{
}
* The subclass of device KeyEvent originated from
*/
Device::Subclass::Type deviceSubclass;
+
+ /**
+ * Whether the key referenced by the event is a repeating key.
+ */
+ bool isRepeat;
};
} // namespace Integration
mCompose(compose),
mDeviceName(deviceName),
mDeviceClass(deviceClass),
- mDeviceSubclass(deviceSubclass)
+ mDeviceSubclass(deviceSubclass),
+ mIsRepeat(false)
{
}
return mState;
}
+bool KeyEvent::IsRepeat() const
+{
+ return mIsRepeat;
+}
+
void KeyEvent::SetKeyName(const std::string& keyName)
{
mKeyName = keyName;
mState = state;
}
+void KeyEvent::SetRepeat(const bool repeat)
+{
+ mIsRepeat = repeat;
+}
+
} // namespace Internal
} // namespace Dali
Dali::KeyEvent::State GetState() const;
/**
+ * @copydoc Dali::KeyEvent::IsRepeat()
+ */
+ bool IsRepeat() const;
+
+ /**
* @brief Set the name given to the key pressed
*
* @param[in] keyName The name given to the key pressed.
*/
void SetState(const Dali::KeyEvent::State& state);
+ /**
+ * @brief Set whether to repeat key event.
+ *
+ * @param[in] repeat Whether the key event is a repeating key.
+ */
+ void SetRepeat(const bool repeat);
+
private:
/**
* @brief Destructor.
std::string mDeviceName; ///< The name of device the key event originated from
Device::Class::Type mDeviceClass; ///< The class of device the key event originated from
Device::Subclass::Type mDeviceSubclass; ///< The subclass of device the key event originated from
+ bool mIsRepeat; ///< Whether the key referenced by the event is a repeating key.
};
} // namespace Internal
void KeyEventProcessor::ProcessKeyEvent(const Integration::KeyEvent& event)
{
KeyEventPtr keyEvent(new KeyEvent(event.keyName, event.logicalKey, event.keyString, event.keyCode, event.keyModifier, event.time, static_cast<Dali::KeyEvent::State>(event.state), event.compose, event.deviceName, event.deviceClass, event.deviceSubclass));
+ keyEvent->SetRepeat(event.isRepeat);
Dali::KeyEvent keyEventHandle(keyEvent.Get());
#ifdef TRACE_ENABLED
return GetImplementation(*this).GetState();
}
+bool KeyEvent::IsRepeat() const
+{
+ return GetImplementation(*this).IsRepeat();
+}
+
KeyEvent::KeyEvent(Internal::KeyEvent* internal)
: BaseHandle(internal)
{
*/
State GetState() const;
+ /**
+ * @brief Checks to see if key event is a repeating key.
+ *
+ * @SINCE_2_2.44
+ * @return Whether the key event is a repeating key.
+ */
+ bool IsRepeat() const;
+
public: // Not intended for application developers
/// @cond internal
/**