fix(x6-plugin-keyboard): triggerKey should use formatKey before call mousetrap #4479
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.
Description
A bugfix of triggerKey function in x6-plugin-keyboard.
Motivation and Context
X6 uses mousetrap as keyboard event listener, but the keys of keyboard are different between X6 and mousetrap. X6 uses a function called "formatKey" to translate X6 keyboard key to mousetrap keyboard key. For example: 'delete' in X6 will translate to 'del' in mousetrap.
But the triggerKey function didn't apply this formatKey function, this cound lead to some misunderstandings, developers may use triggerKey('delete'), but mousetrap accutally can't recognize what 'delete' is. That will look like a bug.
Types of changes
Self Check before Merge