Skip to content

Conversation

@JSUYA
Copy link
Member

@JSUYA JSUYA commented Sep 15, 2022

Converts key event information from NUI to ecore_imf_event and delivers it.

related issue: #340
related pr : flutter-tizen/flutter-tizen#448

Comment on lines 92 to 96
imf_event.key = key;
imf_event.string = string;
imf_event.modifiers = EcoreInputModifiersToEcoreImfModifiers(modifiers);
imf_event.locks = EcoreInputModifiersToEcoreImfLocks(modifiers);
imf_event.keycode = scan_code;
Copy link
Member Author

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.

@JSUYA JSUYA force-pushed the dev/nui_view_swkeyboard branch from d587afc to a5b909b Compare September 15, 2022 09:05
@JSUYA
Copy link
Member Author

JSUYA commented Sep 19, 2022

I will update this patch when #351 is merged.

Comment on lines 349 to 355
void TizenViewElementary::KeyEvent(const char* key,
const char* string,
const char* compose,
uint32_t modifiers,
uint32_t scan_code,
bool is_down) {
FT_UNIMPLEMENTED();
Copy link
Member

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?

Copy link
Member Author

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.

Copy link
Member

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..

Copy link
Member Author

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?

Copy link
Member

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.

@swift-kim swift-kim changed the title Support s/w keyboard input [NUI] Support software keyboard input Sep 19, 2022
@bbrto21
Copy link

bbrto21 commented Sep 21, 2022

Could you please rebase to resolve conflict :)

@JSUYA JSUYA force-pushed the dev/nui_view_swkeyboard branch 2 times, most recently from 1addb73 to 3f1f76a Compare September 27, 2022 02:33
@JSUYA JSUYA force-pushed the dev/nui_view_swkeyboard branch from 45ef385 to 5a11ee2 Compare September 28, 2022 01:23
Comment on lines +201 to +209
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) {
Copy link
Member

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.

Copy link
Member Author

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.

@JSUYA JSUYA force-pushed the dev/nui_view_swkeyboard branch from 5a11ee2 to a98e998 Compare October 5, 2022 06:02
size_t timestamp = 0,
const char* device_name = nullptr,
uint32_t device_class = 0,
uint32_t device_subclass = 0);
Copy link
Member

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?

Copy link
Member Author

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?)

Copy link
Member

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.

Copy link
Member Author

@JSUYA JSUYA Oct 5, 2022

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

@JSUYA JSUYA force-pushed the dev/nui_view_swkeyboard branch from a797b1f to bb88ea0 Compare October 11, 2022 04:07
@JSUYA
Copy link
Member Author

JSUYA commented Oct 12, 2022

@swift-kim @Swanseo0 Are there any more points left to review? Can I merge this?

@swift-kim
Copy link
Member

@JSUYA Yes, you can. Don't forget to

@JSUYA JSUYA merged commit 87e3e3b into flutter-tizen:flutter-3.3.0-tizen Oct 12, 2022
@JSUYA JSUYA linked an issue Oct 12, 2022 that may be closed by this pull request
JSUYA added a commit to flutter-tizen/flutter-tizen that referenced this pull request Oct 12, 2022
Pass timestamp and device info to embedder.

related pr : flutter-tizen/engine#349
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.

Improve text input on NUI view

4 participants