Mouse keyboard adaptation#18656
Merged
Merged
Conversation
Signed-off-by: @wanghui187 <348582973@qq.com>
Code Size Check Report
Interface Check ReportThis pull request does not change any public interfaces ! |
Signed-off-by: @wanghui187 <348582973@qq.com>
qiuguohua
requested review from
dumganhar and
qiuguohua
and removed request for
qiuguohua
April 24, 2025 01:11
dumganhar
reviewed
Apr 24, 2025
dumganhar
reviewed
Apr 24, 2025
dumganhar
reviewed
Apr 24, 2025
Signed-off-by: @wanghui187 <348582973@qq.com>
dumganhar
approved these changes
Apr 25, 2025
dumganhar
reviewed
Apr 25, 2025
qiuguohua
reviewed
Apr 27, 2025
| ev->key = ohKeyCodeToCocosKeyCode(code); | ||
| sendMsgToWorker(cc::MessageType::WM_XCOMPONENT_KEY_EVENT, reinterpret_cast<void*>(ev), window); | ||
| } else { | ||
| DO_CC_LOG_ERROR("OpenHarmonyPlatform::getKeyEventError"); |
Contributor
There was a problem hiding this comment.
Why not use CC_LOG_ERROR?
| ev->type = cc::MouseEvent::Type::UNKNOWN; | ||
| break; | ||
| } | ||
| if(ev->type == cc::MouseEvent::Type::UNKNOWN) return; |
Contributor
There was a problem hiding this comment.
If it returns here, ‘ev’ is not released?
| } | ||
| } | ||
|
|
||
| onMouseWheel(eventType: string,event: PanGestureEvent) { |
Contributor
There was a problem hiding this comment.
Suggested change
| onMouseWheel(eventType: string,event: PanGestureEvent) { | |
| onMouseWheel(eventType: string, event: PanGestureEvent) { |
| resourceManagerInit: (resourceManager: resourceManager.ResourceManager) => void; | ||
| writablePathInit: (cacheDir: string) => void; | ||
| onVideoEvent: (param: string) => void; | ||
| onMouseWheel: (type: string, offsetY:number) => void; |
Contributor
There was a problem hiding this comment.
Suggested change
| onMouseWheel: (type: string, offsetY:number) => void; | |
| onMouseWheel: (type: string, offsetY: number) => void; |
| let matchStandardFactor = 0; | ||
| if (systemInfo.os === OS.OPENHARMONY) { | ||
| matchStandardFactor = 5; | ||
| eventMouse.setScrollData(mouseEvent.wheelDeltaX, mouseEvent.wheelDeltaY * matchStandardFactor); |
Contributor
There was a problem hiding this comment.
Can we annotate why there is such a difference?
Contributor
Author
There was a problem hiding this comment.
According to actual measurements, this coefficient is suitable
Signed-off-by: @wanghui187 <348582973@qq.com>
dumganhar
approved these changes
Apr 29, 2025
qiuguohua
approved these changes
Apr 29, 2025
Signed-off-by: @wanghui187 <348582973@qq.com>
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
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.
Re: #
Changelog
Continuous Integration
This pull request:
Compatibility Check
This pull request: