• Lv0
    粉丝0

积分1 / 贡献0

提问1答案被采纳0文章0

作者动态

    鼠标滚轮问题(OpenHarmony4.0,api10)

    xing 显示全部楼层 发表于 2024-3-21 17:44:56

    onMouse(event: (event: MouseEvent) => void) 回调中无法正确获取滚轮事件。

    滚轮向上和向下回调的 MouseEvent都是一样的,如 {"button":0,"action":3,"displayX":988,"displayY":212,"windowX":988,"windowY":212,"screenX":988,"screenY":212,"x":988,"y":212,"timestamp":493854342000,"source":1,"pressure":0,"sourceTool":0,"target":{"area":{"position":{"x":0,"y":0},"globalPosition":{"x":0,"y":0},"width":1280,"height":720}}}

    看文档也没看到有滚轮的Action。https://docs.openharmony.cn/pages/v4.0/zh-cn/application-dev/reference/arkui-ts/ts-universal-mouse-key.md

    大佬们知道如何获取滚轮的事件吗。。。

    您尚未登录,无法参与评论,登录后可以:
    参与开源共建问题交流
    认同或收藏高质量问答
    获取积分成为开源共建先驱

    精彩评论1

    s_hao

    沙发 发表于 2024-3-26 14:43:05
    由于事件归一要求,鼠标的滚轮事件已纳入到PanGesture中,在对应的组件上绑定PanGesture手势可以实现鼠标滚轮事件相同的效果。具体参考文档:https://docs.openharmony.cn/page ... ures-pangesture.md/

    Copyright   ©2023  OpenHarmony开发者论坛  京ICP备2020036654号-3 |技术支持 Discuz!

    返回顶部