wheel event is originally from pointer input device such as mouse.
however this feature provides wheel up/down functionalities
by handling them as hardware key input.
Change-Id: Ic3a7618efc6bb759b7a4f4bd4ae3559b5e4f6d1f
bool touchMove(const int x, const int y) override;
bool touchUp(const int x, const int y) override;
+ bool wheelUp(int amount, const int durationMs) override;
+ bool wheelDown(int amount, const int durationMs) override;
+
bool pressBack() override;
bool pressHome() override;
bool pressMenu() override;
private:
efl_util_inputgen_h mFakeTouchHandle;
efl_util_inputgen_h mFakeKeyboardHandle;
+ efl_util_inputgen_h mFakeWheelHandle;
static const unsigned int INTV_CLICK = 5;
static const unsigned int INTV_KEYPRESS = 10;
};
virtual bool touchMove(const int x, const int y) = 0;
virtual bool touchUp(const int x, const int y) = 0;
+ virtual bool wheelUp(int amount, const int durationMs) = 0;
+ virtual bool wheelDown(int amount, const int durationMs) = 0;
+
virtual bool pressBack() = 0;
virtual bool pressHome() = 0;
virtual bool pressMenu() = 0;
bool touchMove(const int x, const int y) override;
bool touchUp(const int x, const int y) override;
+ bool wheelUp(int amount, const int durationMs) override;
+ bool wheelDown(int amount, const int durationMs) override;
+
bool pressBack() override;
bool pressHome() override;
bool pressMenu() override;
obj->mFakeTouchHandle = efl_util_input_initialize_generator(EFL_UTIL_INPUT_DEVTYPE_TOUCHSCREEN);
obj->mFakeKeyboardHandle =
efl_util_input_initialize_generator(EFL_UTIL_INPUT_DEVTYPE_KEYBOARD);
+ obj->mFakeWheelHandle = efl_util_input_initialize_generator(EFL_UTIL_INPUT_DEVTYPE_POINTER);
return NULL;
}, this);
}
TizenImpl *obj = static_cast<TizenImpl*>(data);
efl_util_input_deinitialize_generator(obj->mFakeTouchHandle);
efl_util_input_deinitialize_generator(obj->mFakeKeyboardHandle);
+ efl_util_input_deinitialize_generator(obj->mFakeWheelHandle);
return NULL;
}, this);
}
return true;
}
+bool TizenImpl::wheelUp(int amount, const int durationMs)
+{
+ LOG_F(INFO, "wheel up %d for %d", amount, durationMs);
+ auto args = std::make_tuple(this);
+ for (int i = 0; i < amount; i++){
+ ecore_main_loop_thread_safe_call_sync([](void *data)->void*{
+ TizenImpl *obj;
+ std::tie(obj) = *static_cast<std::tuple<TizenImpl*>*>(data);
+ efl_util_input_generate_wheel(obj->mFakeWheelHandle, EFL_UTIL_INPUT_POINTER_WHEEL_HORZ, 1);
+ return NULL;
+ }, (void*)(&args));
+ usleep(durationMs*1000/amount);
+ }
+
+ return true;
+}
+
+bool TizenImpl::wheelDown(int amount, const int durationMs)
+{
+ LOG_F(INFO, "wheel down %d for %d", amount, durationMs);
+ auto args = std::make_tuple(this);
+ for (int i = 0; i < amount; i++){
+ ecore_main_loop_thread_safe_call_sync([](void *data)->void*{
+ TizenImpl *obj;
+ std::tie(obj) = *static_cast<std::tuple<TizenImpl*>*>(data);
+ efl_util_input_generate_wheel(obj->mFakeWheelHandle, EFL_UTIL_INPUT_POINTER_WHEEL_HORZ, -1);
+ return NULL;
+ }, (void*)(&args));
+ usleep(durationMs*1000/amount);
+ }
+
+ return true;
+}
+
bool TizenImpl::drag(const int sx, const int sy, const int ex, const int ey,
const int steps, const int durationMs)
{
return result;
}
+bool UiDevice::wheelUp(int amount, const int durationMs)
+{
+ bool result = mDeviceImpl->wheelUp(amount, durationMs);
+ waitForIdle();
+ return result;
+}
+
+bool UiDevice::wheelDown(int amount, const int durationMs)
+{
+ bool result = mDeviceImpl->wheelDown(amount, durationMs);
+ waitForIdle();
+ return result;
+}
+
bool UiDevice::pressBack()
{
bool result = mDeviceImpl->pressBack();
mDevice->pressVolDown();
else if (type == ::aurum::ReqKey_KeyType::ReqKey_KeyType_POWER)
mDevice->pressPower();
+ else if (type == ::aurum::ReqKey_KeyType::ReqKey_KeyType_WHEELUP)
+ mDevice->wheelUp(1,167);
+ else if (type == ::aurum::ReqKey_KeyType::ReqKey_KeyType_WHEELDOWN)
+ mDevice->wheelDown(1,167);
else if (type == ::aurum::ReqKey_KeyType::ReqKey_KeyType_KEY) {
; // TODO
}
POWER = 5;
KEY = 6;
XF86 = 7;
+ WHEELUP = 8;
+ WHEELDOWN = 9;
}
enum KeyActionType{
PRESS = 0;