Skip to content
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

update keyCode adapting #98

Merged
merged 1 commit into from Mar 16, 2020

Conversation

PPpro
Copy link
Collaborator

@PPpro PPpro commented Mar 16, 2020

changeLog:

  • 适配 pc 微信小游戏 数字键盘按键,并且修复 space 键监听失败的问题

@PPpro PPpro requested a review from holycanvas Mar 16, 2020
pause: 19,
capslock: 20,
escape: 27,
' ': 32,
Copy link
Contributor

@holycanvas holycanvas Mar 16, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

微信他们的空格,就是' '?

Copy link
Collaborator Author

@PPpro PPpro Mar 16, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

是的

backspace: 8,
tab: 9,
enter: 13,
shift: 16,
Copy link
Contributor

@holycanvas holycanvas Mar 16, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

他们没有分leftShift和rightShift?

Copy link
Collaborator Author

@PPpro PPpro Mar 16, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

可以区分,不过我们引擎接口没有提供这种区别

Copy link
Contributor

@holycanvas holycanvas Mar 16, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

其实应该要区分吧,特别是pc游戏,可以之后找时间优化下

Copy link
Contributor

@holycanvas holycanvas Mar 16, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

比如双人游戏,可能leftShift和rightShift是不同人按的

Copy link
Collaborator Author

@PPpro PPpro Mar 16, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个可以优化,包括我们现在用的 keyCode,web 标准也废弃了
https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/keyCode

虽然现在还能正常使用。。。

@holycanvas holycanvas merged commit 71c5137 into cocos-creator-packages:v2.3.3-release Mar 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants