flutter-tizen / engine

The Flutter engine
https://flutter.dev
BSD 3-Clause "New" or "Revised" License
6 stars 19 forks source link

[Key mapping issue]Exception was thrown by flutter framework when press 'Menu' key on TV device #229

Closed xiaowei-guan closed 2 years ago

xiaowei-guan commented 2 years ago

══╡ EXCEPTION CAUGHT BY SERVICES LIBRARY ╞══════════════════════════════════════════════════════════ The following assertion was thrown during a platform message callback: Attempted to send a key down event when no keys are in keysPressed. This state can occur if the key event being sent doesn't properly set its modifier flags. This was the event: RawKeyDownEvent#80af0(logicalKey: LogicalKeyboardKey#00106(keyId: "0x200000106", keyLabel: "Meta Left", debugName: "Meta Left"), physicalKey: PhysicalKeyboardKey#700e3(usbHidUsage: "0x000700e3", debugName: "Meta Left")) and its data: RawKeyEventDataLinux#ef142(toolkit: GTK, unicodeScalarValues: 0, scanCode: 133, keyCode: 65511, modifiers: 0, isDown: true) 'package:flutter/src/services/raw_keyboard.dart': Failed assertion: line 694 pos 7: 'event is! RawKeyDownEvent || _keysPressed.isNotEmpty'

Either the assertion indicates an error in the framework itself, or we should provide substantially more information in this error message to help you determine and fix the underlying cause. In either case, please report this assertion by filing a bug on GitHub: https://github.com/flutter/flutter/issues/new?template=2_bug.md

When the exception was thrown, this was the stack:

2 RawKeyboard.handleRawKeyEvent (package:flutter/src/services/raw_keyboard.dart:694:7)

3 KeyEventManager.handleRawKeyMessage (package:flutter/src/services/hardware_keyboard.dart:818:33)

4 BasicMessageChannel.setMessageHandler. (package:flutter/src/services/platform_channel.dart:77:49)

5 BasicMessageChannel.setMessageHandler. (package:flutter/src/services/platform_channel.dart:76:47)

6 _DefaultBinaryMessenger.setMessageHandler. (package:flutter/src/services/binding.dart:389:35)

7 _DefaultBinaryMessenger.setMessageHandler. (package:flutter/src/services/binding.dart:386:46)

8 _invoke2. (dart:ui/hooks.dart:189:15)

12 _invoke2 (dart:ui/hooks.dart:188:10)

13 _ChannelCallbackRecord.invoke (dart:ui/channel_buffers.dart:42:5)

14 _Channel.push (dart:ui/channel_buffers.dart:132:31)

15 ChannelBuffers.push (dart:ui/channel_buffers.dart:329:17)

16 PlatformDispatcher._dispatchPlatformMessage (dart:ui/platform_dispatcher.dart:544:22)

17 _dispatchPlatformMessage (dart:ui/hooks.dart:83:31)

(elided 5 frames from class _AssertionError and dart:async) ════════════════════════════════════════════════════════════════════════════════════════════════════

xiaowei-guan commented 2 years ago

'Menu' keycode is 0X85 on TV device. {0x00000085, 65511}, // LogicalKeyboardKey.metaLeft

swift-kim commented 2 years ago

Do you want to capture the menu button in your app or can you simply ignore it? In the latter case we can just remove the mapping from key_event_channel.cc.

xiaowei-guan commented 2 years ago

Do you want to capture the menu button in your app or can you simply ignore it? In the latter case we can just remove the mapping from key_event_channel.cc.

I think we can ignore this issue for now, because it doesn't affect app development.

swift-kim commented 2 years ago

Related to https://github.com/flutter-tizen/flutter-tizen/issues/319.