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

fix: format keyboard arrow codes to Mousetrap special codes (#4065) #4080

Merged
merged 1 commit into from
Jan 9, 2024

Conversation

XueMeijing
Copy link
Contributor

Description

fix #4065 , Keyboard插件绑定上下左右几个箭头事件的时候,回调函数里使用return false也不能阻止浏览器默认事件,看了Mousetrap文档说这几个方向键对应的key是up right down left, 而浏览器原生事件里的code是ArrowUp ArrowRight ArrowDown ArrowLeft, 所以修改了keyboard.ts的 formatkey 方法,把这几个key转成Mousetrap需要的格式

image
image

Motivation and Context

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Enhancement (changes that improvement of current feature or performance)
  • Refactoring (changes that neither fixes a bug nor adds a feature)
  • Test Case (changes that add missing tests or correct existing tests)
  • Code style optimization (changes that do not affect the meaning of the code)
  • Docs (changes that only update documentation)
  • Chore (changes that don't modify src or test files)

Self Check before Merge

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@x6-bot x6-bot bot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. PR: unreviewed PR does not have any reviews. labels Dec 6, 2023
@NewByVector NewByVector merged commit 4641d39 into antvis:master Jan 9, 2024
16 checks passed
@x6-bot x6-bot bot added PR: merged PR has merged. and removed PR: unreviewed PR does not have any reviews. labels Jan 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: merged PR has merged. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

自定义键盘事件和浏览器默认键盘事件冲突,比如mac下 meta+1 是切换到第一个标签页
2 participants