OpenHarmony开发者论坛

标题: 鼠标滚轮问题(OpenHarmony4.0,api10) [打印本页]

作者: xing    时间: 2024-3-21 17:44
标题: 鼠标滚轮问题(OpenHarmony4.0,api10)
[md]在 `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/page ... versal-mouse-key.md


大佬们知道如何获取滚轮的事件吗。。。
[/md]
作者: s_hao    时间: 2024-3-26 14:43
由于事件归一要求,鼠标的滚轮事件已纳入到PanGesture中,在对应的组件上绑定PanGesture手势可以实现鼠标滚轮事件相同的效果。具体参考文档:https://docs.openharmony.cn/page ... ures-pangesture.md/




欢迎光临 OpenHarmony开发者论坛 (https://forums.openharmony.cn/) Powered by Discuz! X3.5