Skip to content

Conversation

@swift-kim
Copy link
Member

@swift-kim swift-kim commented Feb 4, 2022

Fixes flutter-tizen/flutter-tizen#319. Substitutes the previous change #232.

Changes

  • Let some special system keys (including XF86AudioPlayPause) be redefinable by the app. ecore_wl2_window_keygrab_set and eext_win_keygrab_set were used to override the system's default behavior.
  • Add efl-extension dependency (for eext_win_keygrab_set).
  • Implement character to UTF32 code point conversion to support RawKeyEvent.character.
  • Make KeyEventHandler::OnKey return ECORE_CALLBACK_DONE (instead of ECORE_CALLBACK_PASS_ON) by default.
  • Update the value of modifierMeta (1 << 28 to 1 << 26).

Cleanups

  • Use consistent words in variable names and comments (e.g. physical key code → scan code).
  • Rename variables to clarify their meaning (e.g. keyevent).
  • Make the structures of key_event_handler.cc and touch_event_handler.cc analogous to each other.

To test this PR (details):

$ TIZEN_ENGINE_GITHUB_RUN_ID=1804716824 flutter-tizen precache --tizen
$ flutter-tizen run --verbose-system-logs

@swift-kim
Copy link
Member Author

swift-kim commented Feb 4, 2022

I decided not to apply #221 right now because it adds too much complexity without much benefit.

We still need to implement it in the near future in order to enable more key mapping (currently only keys that are listed in kGtkToLogicalKey are supported).

Comment on lines 286 to 289
uint32_t scan_code = key->keycode;
auto iter = kSymbolToScanCode.find(key->key);
if (iter != kSymbolToScanCode.end()) {
scan_code = iter->second;
Copy link
Member Author

@swift-kim swift-kim Feb 4, 2022

Choose a reason for hiding this comment

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

This remapping is unavoidable because TV devices use their own key layout. For example, XF86SysMenu on TV remote control is defined as 0x00000085 (Meta Left). Remapping only logical key codes didn't work.

@swift-kim swift-kim marked this pull request as draft February 4, 2022 11:01
@swift-kim swift-kim marked this pull request as ready for review February 7, 2022 05:05
@swift-kim swift-kim requested a review from a team February 7, 2022 05:29
@swift-kim swift-kim changed the base branch from flutter-2.8.1-tizen to flutter-2.10.0-tizen February 9, 2022 06:15
Copy link

@bbrto21 bbrto21 left a comment

Choose a reason for hiding this comment

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

LGTM

@bbrto21
Copy link

bbrto21 commented Feb 11, 2022

After applying this PR, I confirmed that the "Not available" popup no longer appears on my TV with devel board

@Aliaksandr-Tuzik
Copy link

@swift-kim, is there a reason it goes into Flutter 2.10 and not in 2.8? Can this be done for 2.8 as well?

@swift-kim
Copy link
Member Author

@AliaksandrTuzik We usually support only one Flutter version at a time (i.e. the flutter-tizen tool follows a linear versioning policy) to reduce maintenance workload and do not provide updates for older versions. However as flutter-tizen/flutter-tizen#326 has not been merged yet, we can release this patch for Flutter 2.8 first and then finish the migration to Flutter 2.10, if you want. How do you think?

@Aliaksandr-Tuzik
Copy link

@AliaksandrTuzik We usually support only one Flutter version at a time (i.e. the flutter-tizen tool follows a linear versioning policy) to reduce maintenance workload and do not provide updates for older versions. However as flutter-tizen/flutter-tizen#326 has not been merged yet, we can release this patch for Flutter 2.8 first and then finish the migration to Flutter 2.10, if you want. How do you think?

That would be great!

@swift-kim swift-kim changed the base branch from flutter-2.10.0-tizen to flutter-2.8.1-tizen February 11, 2022 09:23
@swift-kim swift-kim merged commit dfe4c38 into flutter-tizen:flutter-2.8.1-tizen Feb 11, 2022
swift-kim added a commit that referenced this pull request Feb 11, 2022
* Improve key event handling for TV remote controls

* Fix x64 build

* Minimize key remapping

* Rename kModifierMap
swift-kim added a commit that referenced this pull request Feb 11, 2022
* Improve key event handling for TV remote controls

* Fix x64 build

* Minimize key remapping

* Rename kModifierMap
swift-kim added a commit that referenced this pull request Feb 11, 2022
* Improve key event handling for TV remote controls

* Fix x64 build

* Minimize key remapping

* Rename kModifierMap
swift-kim added a commit that referenced this pull request May 12, 2022
* Improve key event handling for TV remote controls

* Fix x64 build

* Minimize key remapping

* Rename kModifierMap
swift-kim added a commit that referenced this pull request Aug 5, 2022
* Improve key event handling for TV remote controls

* Fix x64 build

* Minimize key remapping

* Rename kModifierMap
swift-kim added a commit that referenced this pull request Sep 1, 2022
* Improve key event handling for TV remote controls

* Fix x64 build

* Minimize key remapping

* Rename kModifierMap
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.

TV Remote keys handling

3 participants