END_TEST;
}
+int UtcDaliKeyEventIsNoInterceptModifier(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); // set name to test, key string to i and modifier to shift
+ DALI_TEST_CHECK(event);
+
+ DALI_TEST_EQUALS(false, event.IsNoInterceptModifier(), TEST_LOCATION);
+
+ DevelKeyEvent::SetNoInterceptModifier(event, true);
+ DALI_TEST_EQUALS(true, event.IsNoInterceptModifier(), TEST_LOCATION);
+
+ DevelKeyEvent::SetNoInterceptModifier(event, false);
+ DALI_TEST_EQUALS(false, event.IsNoInterceptModifier(), TEST_LOCATION);
+
+ END_TEST;
+}
+
// Positive fail test case for a method
int UtcDaliKeyEventIsNotShiftModifier(void)
{
GetImplementation(keyEvent).SetKeyModifier(keyModifier);\r
}\r
\r
+void SetNoInterceptModifier(KeyEvent keyEvent, bool noIntercept)\r
+{\r
+ GetImplementation(keyEvent).SetNoInterceptModifier(noIntercept);\r
+}\r
+\r
void SetTime(KeyEvent keyEvent, unsigned long time)\r
{\r
GetImplementation(keyEvent).SetTime(time);\r
DALI_CORE_API void SetKeyModifier(KeyEvent keyEvent, int32_t keyModifier);\r
\r
/**\r
+ * @brief Set the no-intercept key modifier.\r
+ *\r
+ * @SINCE_2_3.13\r
+ * @param[in] keyEvent The instance of KeyEvent\r
+ * @param[in] noIntercept The value of the modifier\r
+ */\r
+DALI_CORE_API void SetNoInterceptModifier(KeyEvent keyEvent, bool noIntercept);\r
+\r
+/**\r
* @brief Set the time (in ms) that the key event occurred.\r
*\r
* @SINCE_1_9.27\r
{
namespace
{
-const uint32_t MODIFIER_SHIFT = 0x1;
-const uint32_t MODIFIER_CTRL = 0x2;
-const uint32_t MODIFIER_ALT = 0x4;
-const int32_t KEY_INVALID_CODE = -1;
+const uint32_t MODIFIER_SHIFT = 0x1;
+const uint32_t MODIFIER_CTRL = 0x2;
+const uint32_t MODIFIER_ALT = 0x4;
+const uint32_t MODIFIER_NO_INTERCEPT = (1U << 31);
+const int32_t KEY_INVALID_CODE = -1;
} // namespace
namespace Internal
return ((MODIFIER_ALT & mKeyModifier) == MODIFIER_ALT);
}
+bool KeyEvent::IsNoInterceptModifier() const
+{
+ return ((MODIFIER_NO_INTERCEPT & mKeyModifier) == MODIFIER_NO_INTERCEPT);
+}
+
const std::string& KeyEvent::GetCompose() const
{
return mCompose;
mKeyModifier = keyModifier;
}
+void KeyEvent::SetNoInterceptModifier(bool noIntercept)
+{
+ if(noIntercept)
+ {
+ mKeyModifier |= MODIFIER_NO_INTERCEPT;
+ }
+ else
+ {
+ mKeyModifier &= ~MODIFIER_NO_INTERCEPT;
+ }
+}
+
void KeyEvent::SetTime(unsigned long time)
{
mTime = time;
bool IsAltModifier() const;
/**
+ * @copydoc Dali::KeyEvent::IsNoInterceptModifier()
+ */
+ bool IsNoInterceptModifier() const;
+
+ /**
* @copydoc Dali::KeyEvent::GetCompose()
*/
const std::string& GetCompose() const;
void SetKeyModifier(int32_t keyModifier);
/**
+ * @brief Set the no-intercept key modifier.
+ *
+ * @param[in] noIntercept The value of the modifier
+ */
+ void SetNoInterceptModifier(bool noIntercept);
+
+ /**
* @brief Set the time (in ms) that the key event occurred.
*
* @param[in] time The time (in ms)
});
// Emit the key event signal from the scene.
- bool consumed = mScene.EmitInterceptKeyEventSignal(keyEventHandle);
+ bool consumed = false;
+ if(!keyEventHandle.IsNoInterceptModifier())
+ {
+ consumed = mScene.EmitInterceptKeyEventSignal(keyEventHandle);
+ }
if(!consumed)
{
consumed = mScene.EmitKeyEventGeneratedSignal(keyEventHandle);
/*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
return GetImplementation(*this).IsAltModifier();
}
+bool KeyEvent::IsNoInterceptModifier() const
+{
+ return GetImplementation(*this).IsNoInterceptModifier();
+}
+
const std::string& KeyEvent::GetCompose() const
{
return GetImplementation(*this).GetCompose();
#define DALI_KEY_EVENT_H
/*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
bool IsAltModifier() const;
/**
+ * @brief Checks if the no-intercept key modifier has been supplied.
+ *
+ * @SINCE_2_3.13
+ * @return True if no-intercept modifier is present
+ */
+ bool IsNoInterceptModifier() const;
+
+ /**
* @brief Get the key compose string.
*
* @SINCE_1_9.27