forked from flutter/engine
-
Notifications
You must be signed in to change notification settings - Fork 17
Implement the hardware keyboard interface #297
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
Merged
swift-kim
merged 16 commits into
flutter-tizen:flutter-3.0.0-tizen
from
swift-kim:hardware-keyboard
Jun 28, 2022
Merged
Implement the hardware keyboard interface #297
swift-kim
merged 16 commits into
flutter-tizen:flutter-3.0.0-tizen
from
swift-kim:hardware-keyboard
Jun 28, 2022
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
bbrto21
reviewed
Jun 14, 2022
This comment was marked as resolved.
This comment was marked as resolved.
570be41 to
dcd66c1
Compare
Member
Author
|
@swift-kim Thanks, problem solved! |
bbrto21
approved these changes
Jun 24, 2022
JSUYA
reviewed
Jun 24, 2022
JSUYA
approved these changes
Jun 27, 2022
Member
JSUYA
left a comment
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.
LGTM :)
swift-kim
added a commit
that referenced
this pull request
Aug 5, 2022
swift-kim
added a commit
that referenced
this pull request
Sep 1, 2022
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.
Closes #221.
Please read this page for differences between the legacy RawKeyboard API and the new HardwareKeyboard API.
Since the legacy API has not been deprecated yet, a key event must be sent to the framework twice through the conventional platform channel and also the new embedder API (
FlutterEngineSendKeyEvent) simultaneously. In our code, it's done by theSendChannelEventandSendEmbedderEventmethods in theKeyEventChannelclass respectively. As commented in the code, theKeyEventChannelclass will be renamed and refactored once the old API is fully removed from the framework.For the implementation, I referred to the desktop embedders (Windows and Linux) code. Since there's no numeric value that represents a "logical key code" on Tizen, I created a direct mapping (
kSymbolToLogicalKeyCode) from key symbols (string) to Flutter's logical key codes.There are also some other changes to code related to the legacy API:
key_mapping.ccfile.kSymbolToScanCode). This will affect existing apps that depend on physical key codes such asmediaPlayPause(the Play/Pause button on TV) andcontextMenu(the Menu button on mobile).stringinstead ofcompose.XF86SysMenu(TV remote control's Menu button which opens up the TV settings) has been removed fromkBindableSystemKeysand now it's never handled by the app.I'll do some more testing in this week. To test this change, you may create an app that contains Focus widgets such as KeyboardListener (new API) and RawKeyboardListener (legacy API) and implement
onKeyoronKeyEvent.