-
Notifications
You must be signed in to change notification settings - Fork 22
Feature/support mouse event #37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
comesx4
wants to merge
7
commits into
OpenHarmony-NET:main
Choose a base branch
from
comesx4:feature/support_mouse_event
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
在 `AvaloniaXComponent.cs` 中新增了鼠标和悬停事件的处理方法。更新了类和方法的 XML 注释,改进了字段命名和 OpenGL ES 初始化逻辑, 在 `XComponent.cs` 中增加了构造函数和方法的注释,提升了代码的可读性和可维护性。
在 `AvaloniaXComponent.cs` 中,`DispatchHoverEvent` 方法添加了调试日志记录的 TODO 注释,以便将来实现详细的日志记录功能。 在 `XComponentEntry.cs` 中,新增了两个静态方法 `DispatchMouseEvent` 和 `DispatchHoverEvent`,用于处理鼠标事件和悬停事件的分发,这些方法通过 `UnmanagedCallersOnly` 特性标记,以便从非托管代码调用。 在 `napi_init.cs` 中,添加了对鼠标事件回调的注册,包括 `DispatchMouseEvent` 和 `DispatchHoverEvent` 的回调指针,以支持鼠标事件的处理。 在 `MainView.axaml` 中,修复了 `UrsaView` 的 XML 命名空间声明,确保其正确性和完整性。
替换原有提交记录 `6f9199df83bcb307d9f80e1e19f561f44cb32086` 为新的提交记录 `bfb1fed93e76fda1a24aed36e363ce09a23508cd`,可能包含代码或功能的更新与修复。
在 `AvaloniaXComponent.cs` 文件中,添加了对鼠标事件的检查逻辑。如果 `mouseEvent.action` 为 `OH_NativeXComponent_MouseEventAction.OH_NATIVEXCOMPONENT_MOUSE_NONE`,则直接返回,避免执行不必要的代码。这一改动提高了代码的效率和可读性。
将讨论与审查 |
能否提供断点位置与更多调试相关信息加速调查?
…________________________________
发件人: zhijun zhou ***@***.***>
发送时间: 星期三, 七月 9, 2025 4:01:23 下午
收件人: OpenHarmony-NET/OpenHarmony.Avalonia ***@***.***>
抄送: 望尘空忧 ***@***.***>; Comment ***@***.***>
主题: Re: [OpenHarmony-NET/OpenHarmony.Avalonia] Feature/support mouse event (PR #37)
[https://avatars.githubusercontent.com/u/7337992?s=20&v=4]comesx4 left a comment (OpenHarmony-NET/OpenHarmony.Avalonia#37)<#37 (comment)>
确认和Tap事件会重复触发事件,需要评估如何避免重复事件
―
Reply to this email directly, view it on GitHub<#37 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ATVAOGA357IMSLPM7OEFQQL3HTD3ZAVCNFSM6AAAAACA46UFD2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTANJRGU4DQMBZHE>.
You are receiving this because you commented.
|
在 `OHDebugHelper.cs` 中添加了 `Error` 方法以记录错误日志,并重载了该方法以支持标题和异常信息。 在 `MainView.axaml` 中新增“触摸板和鼠标事件”选项卡,包含 `TouchAndMousePage` 视图。 在 `TouchAndMousePage.axaml` 中创建了新的用户控件,包含按钮和日志列表框,并设置了相应的布局和样式。 在 `TouchAndMousePage.axaml.cs` 中添加了多个指针事件处理程序,记录事件信息到日志,并实现了日志更新时自动滚动到列表框底部的功能。
在 `AvaloniaXComponent.cs` 文件中,增加了触摸事件处理逻辑,确保只处理手指触摸。 在 `TouchAndMousePage.axaml` 文件中,调整了按钮的尺寸并添加了提示文本块。 在 `TouchAndMousePage.axaml.cs` 文件中,重命名了事件处理方法,并确保 `TestButton` 和 `TestTextBlock` 能响应相同的触摸和鼠标事件。
WCKYWCKF
requested changes
Jul 18, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
鼠标滚轮事件在此PR中从未被触发,除此外效果良好
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
增加鼠标事件实现