-
Notifications
You must be signed in to change notification settings - Fork 17
[NUI] Support software keyboard input #349
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
[NUI] Support software keyboard input #349
Conversation
| imf_event.key = key; | ||
| imf_event.string = string; | ||
| imf_event.modifiers = EcoreInputModifiersToEcoreImfModifiers(modifiers); | ||
| imf_event.locks = EcoreInputModifiersToEcoreImfLocks(modifiers); | ||
| imf_event.keycode = scan_code; |
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.
EcoreEvent passes more information than this.
But I don't know why they are needed.
When I tested, only key and string were sufficient.
(ewk webview only uses key and string. (evas event))
https://github.com/flutter-tizen/plugins/pull/400/files/50ac06ef0278cdf8ab3d814ab3aee7d0fabe6135#diff-c41c7de9898e3e8e225393fb4381982fb6248999451c306948584e1c330d10afR289)
If we need more, I can get it from NUI, but there is no API to get compose and time stamp information in NUI's key event.
d587afc to
a5b909b
Compare
|
I will update this patch when #351 is merged. |
| void TizenViewElementary::KeyEvent(const char* key, | ||
| const char* string, | ||
| const char* compose, | ||
| uint32_t modifiers, | ||
| uint32_t scan_code, | ||
| bool is_down) { | ||
| FT_UNIMPLEMENTED(); |
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.
Will this ever be implemented in the future or be no-op?
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.
Actually, I'm not sure if this will ever be used in ElmTizenVIew.
I modified it to no-op.
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.
We may have a better design in the future..
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.
I wrapped the code used only for nui with NUI_SUPPORT and deleted TizenViewElementary::OnKey.
Could you please review it again?
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.
I'm afraid the code is not very predictable but I'm okay with the change.
|
Could you please rebase to resolve conflict :) |
1addb73 to
3f1f76a
Compare
45ef385 to
5a11ee2
Compare
| bool TizenInputMethodContext::HandleNuiKeyEvent(const char* device_name, | ||
| uint32_t device_class, | ||
| uint32_t device_subclass, | ||
| const char* key, | ||
| const char* string, | ||
| uint32_t modifiers, | ||
| uint32_t scan_code, | ||
| size_t timestamp, | ||
| bool is_down) { |
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.
This method (or TizenViewNui::OnKey) has too many parameters. They may be wrapped up into a class or struct but I'm not sure if it's a good solution.
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.
These are all Ecore_Events, but NUI doesn't provide all properties of EcoreEvent (maybe?).
I think we can add a struct NuiEventKey(?) structure, but I'd like to improve it in another PR if needed.
5a11ee2 to
a98e998
Compare
| size_t timestamp = 0, | ||
| const char* device_name = nullptr, | ||
| uint32_t device_class = 0, | ||
| uint32_t device_subclass = 0); |
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.
Does the C standard support "default arguments" or function overloading?
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.
Default argument is c++ feature.
But because of extern "C", symbols will be saved without default argument applied.(Maybe?) and since there are no duplicate symbols, it doesn't seem to be a problem now.
Is there any good way?
(The failure of githubaction doesn't seem to be due to this?)
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.
Even if the code compiles without any error, it doesn't seem a good practice. A better way would be explicitly passing the default values (nullptr or 0) or defining a struct type as I mentioned above.
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.
I reverted this patch(Change to default parameter) This was bad code.
I will consider the struct type parameter for NUI later. Until then, I want to keep it as it is.
+) @Swanseo0
Converts key event information from NUI to ecore_imf_event and delivers it.
This reverts commit a98e998.
a797b1f to
bb88ea0
Compare
|
@swift-kim @Swanseo0 Are there any more points left to review? Can I merge this? |
|
@JSUYA Yes, you can. Don't forget to
|
Pass timestamp and device info to embedder. related pr : flutter-tizen/engine#349
Converts key event information from NUI to ecore_imf_event and delivers it.
related issue: #340
related pr : flutter-tizen/flutter-tizen#448