Skip to content

Refactor the key event handling #291

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
merged 12 commits into from
Jun 2, 2022

Conversation

bbrto21
Copy link

@bbrto21 bbrto21 commented May 27, 2022

  • Removes platform dependencies from all SendKeyEvent methods.
  • Adds methods related to composing a text to the FlutterView and
    TextInputChannel.
  • Transfers the key event filter role to TizenInputMethodContext.
  • Adds filter methods for each event type to TizenInputMethodContext.
  • Removes the concept of selection mode for text input.

bbrto21 added 3 commits May 25, 2022 13:44
* Remove the window dependency from TizenInputMethodContext

Signed-off-by: Boram Bae <[email protected]>
* Removes platform dependencies from all SendKeyEvent methods.
* Adds methods related to composing a text to the FlutterView and
  TextInputChannel.
* Transfers the key event filter role to TizenInputMethodContext.
* Adds filter methods for each event type to TizenInputMethodContext.
* Removes the concept of selection mode for text input.

Signed-off-by: Boram Bae <[email protected]>
@bbrto21 bbrto21 changed the title Refactor key Refactor the key event handling May 27, 2022
@bbrto21
Copy link
Author

bbrto21 commented May 27, 2022

contribute to flutter-tizen/flutter-tizen#351

Comment on lines 208 to 220
if (text_input_channel_->SendKeyEvent(key, string, compose, modifiers,
keycode, is_down)) {
return;
}
}

if (engine_->platform_view_channel()) {
engine_->platform_view_channel()->SendKeyEvent(event, is_down);
engine_->platform_view_channel()->SendKeyEvent(key, string, compose,
modifiers, keycode, is_down);
}

if (engine_->key_event_channel()) {
engine_->key_event_channel()->SendKeyEvent(
Copy link
Member

Choose a reason for hiding this comment

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

These SendKeyEvent methods defined by each "channel" class have similar method signatures. How about defining a common interface for them?

It might be hard to define such interface because TextInputChannel's SendKeyEvent is synchronous while KeyEventChannel's SendKeyEvent is asynchronous.

Copy link
Author

Choose a reason for hiding this comment

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

I already thought about this, but I didn't include it in this PR. because this topic got me thinking too much :(
In the end, I excluded this in order to achieve the purpose of this PR quickly. But it's still on the list I want to refactor.

Copy link
Member

Choose a reason for hiding this comment

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

Alright. You might take care of this later.

Signed-off-by: Boram Bae <[email protected]>
Copy link
Member

@bwikbs bwikbs left a comment

Choose a reason for hiding this comment

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

There are minor disagreements at here 😄
(In my case) It's pretty good to me.
Thanks for your hard working!! 👍

Signed-off-by: Boram Bae <[email protected]>
Copy link
Member

@JSUYA JSUYA left a comment

Choose a reason for hiding this comment

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

I have checked the modifications to the codes I reviewed.
looks good to me
wait for swift-kim 's approve

bbrto21 added 3 commits June 2, 2022 10:55
* From Filter to Handle

Signed-off-by: Boram Bae <[email protected]>
Signed-off-by: Boram Bae <[email protected]>
Signed-off-by: Boram Bae <[email protected]>
@bbrto21 bbrto21 force-pushed the refactor_key branch 2 times, most recently from 3db24b5 to 12d051c Compare June 2, 2022 05:45
@swift-kim swift-kim merged commit e534a7c into flutter-tizen:flutter-3.0.0-tizen Jun 2, 2022
swift-kim pushed a commit that referenced this pull request Aug 5, 2022
* Removes platform dependencies from all SendKeyEvent methods.
* Adds methods related to composing a text to the FlutterView and
  TextInputChannel.
* Transfers the key event filter role to TizenInputMethodContext.
* Adds filter methods for each event type to TizenInputMethodContext.
* Removes the concept of selection mode for text input.

Signed-off-by: Boram Bae <[email protected]>
swift-kim pushed a commit that referenced this pull request Sep 1, 2022
* Removes platform dependencies from all SendKeyEvent methods.
* Adds methods related to composing a text to the FlutterView and
  TextInputChannel.
* Transfers the key event filter role to TizenInputMethodContext.
* Adds filter methods for each event type to TizenInputMethodContext.
* Removes the concept of selection mode for text input.

Signed-off-by: Boram Bae <[email protected]>
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.

4 participants