From ccc6c00b16d0439023f85ca857d76e3547572a92 Mon Sep 17 00:00:00 2001 From: jiangwenyu Date: Thu, 21 Sep 2023 07:14:02 +0000 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3wayland=E5=8D=8F=E8=AE=AE?= =?UTF-8?q?=E9=94=AE=E7=9B=98/=E9=BC=A0=E6=A0=87=E4=B8=8A=E6=8A=A5?= =?UTF-8?q?=E4=BA=8B=E4=BB=B6=E7=9A=84=E6=97=B6=E9=97=B4=E6=88=B3=EF=BC=9A?= =?UTF-8?q?=E6=97=B6=E9=97=B4=E6=88=B3=E5=8D=95=E4=BD=8D=E4=B8=BAms?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: jiangwenyu --- wayland_adapter/framework/core/wayland_surface.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/wayland_adapter/framework/core/wayland_surface.cpp b/wayland_adapter/framework/core/wayland_surface.cpp index a077929..4c7ca4f 100644 --- a/wayland_adapter/framework/core/wayland_surface.cpp +++ b/wayland_adapter/framework/core/wayland_surface.cpp @@ -26,6 +26,7 @@ namespace FT { namespace Wayland { namespace { constexpr HiLogLabel LABEL = {LOG_CORE, HILOG_DOMAIN_WAYLAND, "WaylandSurface"}; + constexpr uint32_t US_TO_MS = 1000; } class InputEventConsumer : public OHOS::Rosen::IInputEventConsumer @@ -87,7 +88,7 @@ bool InputEventConsumer::OnInputEvent(const std::shared_ptr } for (auto &keyboard : keyboardList) { - keyboard->OnKeyboardKey(keyEvent->GetKeyCode(), keyAction, keyEvent->GetActionTime()); + keyboard->OnKeyboardKey(keyEvent->GetKeyCode(), keyAction, keyEvent->GetActionTime() / US_TO_MS); } keyEvent->MarkProcessed(); return true; @@ -137,12 +138,12 @@ bool InputEventConsumer::OnInputEvent(const std::shared_ptrGetButtonId()); if (buttonId != OHOS::MMI::PointerEvent::BUTTON_NONE) { for (auto &pointer : pointerList) { - pointer->OnPointerButton(pointerEvent->GetActionTime(), buttonId, pointerItem.IsPressed()); + pointer->OnPointerButton(pointerEvent->GetActionTime() / US_TO_MS, buttonId, pointerItem.IsPressed()); } } } else if (pointerEvent->GetPointerAction() == OHOS::MMI::PointerEvent::POINTER_ACTION_MOVE) { for (auto &pointer : pointerList) { - pointer->OnPointerMotionAbsolute(pointerEvent->GetActionTime(), pointerItem.GetWindowX(), pointerItem.GetWindowY()); + pointer->OnPointerMotionAbsolute(pointerEvent->GetActionTime() / US_TO_MS, pointerItem.GetWindowX(), pointerItem.GetWindowY()); } } return true; -- Gitee