go-flutter-desktop / go-flutter

Flutter on Windows, MacOS and Linux - based on Flutter Embedding, Go and GLFW.
https://hover.build/
BSD 3-Clause "New" or "Revised" License
5.85k stars 283 forks source link

Attempted to send a key down event when no keys are in keysPressed (keyLabel: "k"). #621

Open xiaoming857 opened 2 years ago

xiaoming857 commented 2 years ago

Hover doctor

$ hover doctor
hover: Hover version v0.46.3 running on windows
hover: Sharing packaging tools
hover: darwin-bundle is supported
hover: Packaging darwin-dmg is not supported on windows
hover: To still package darwin-dmg on windows you need to run hover with the `--docker` flag.
hover: Packaging darwin-pkg is not supported on windows
hover: To still package darwin-pkg on windows you need to run hover with the `--docker` flag.
hover: Packaging linux-appimage is not supported on windows
hover: To still package linux-appimage on windows you need to run hover with the `--docker` flag.
hover: Packaging linux-deb is not supported on windows
hover: To still package linux-deb on windows you need to run hover with the `--docker` flag.
hover: Packaging linux-pkg is not supported on windows
hover: To still package linux-pkg on windows you need to run hover with the `--docker` flag.
hover: Packaging linux-rpm is not supported on windows
hover: To still package linux-rpm on windows you need to run hover with the `--docker` flag.
hover: Packaging linux-snap is not supported on windows
hover: To still package linux-snap on windows you need to run hover with the `--docker` flag.
hover: To package windows-msi these tools are required: candle
hover: Install the WiX Toolset from https://wixtoolset.org/releases/
hover: To still package windows-msi without the required tools installed you need to run hover with the `--docker` flag.
hover:
hover: Sharing flutter version
Flutter 2.0.2 • channel beta • https://github.com/flutter/flutter.git
Framework • revision 8962f6dc68 (7 months ago) • 2021-03-11 13:22:20 -0800
Engine • revision 5d8bf811b3
Tools • Dart 2.12.1
hover: Flutter engine commit: https://github.com/flutter/engine/commit/5d8bf811b3072390933d69f3e289a4bb673636c4
hover: Finding out the C compiler version
gcc (tdm64-1) 10.3.0
Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

hover: Sharing the content of go.mod
module github.com/raveltan/diamondv2-desktop/go

go 1.15

require (
        github.com/go-flutter-desktop/go-flutter v0.43.0
        github.com/go-flutter-desktop/plugins/image_picker v0.1.5
        github.com/go-flutter-desktop/plugins/path_provider v0.4.0
        github.com/gopherjs/gopherjs v0.0.0-20200217142428-fce0ec30dd00 // indirect
        github.com/kr/text v0.2.0 // indirect
        github.com/pkg/errors v0.9.1
        github.com/smartystreets/assertions v1.2.0 // indirect
        github.com/stretchr/testify v1.7.0 // indirect
        golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c // indirect
        gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
        gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
)
hover: Sharing the content of hover.yaml
application-name: ""
executable-name: ""
package-name: ""
organization-name: buatkode.com
license: ""
target: lib/main_desktop.dart
branch: ""
cache-path: ""
opengl: ""
engine-version: ""
hover: Sharing the content of go/cmd
go\cmd\main.go  go\cmd\options.go

Flutter doctor

$ flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel beta, 2.0.2, on Microsoft Windows [Version 10.0.19042.1165], locale en-US)
[√] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
[√] Chrome - develop for the web
[!] Android Studio (not installed)
[√] Connected device (2 available)

! Doctor found issues in 1 category.

Error output

The exception I got when I typed several k characters into a textfield, this only occured when I am in windows (not on linux) and it only occured with only k key (US-keyboard):

══╡ 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#b7622(logicalKey: LogicalKeyboardKey#0006b(keyId: "0x0000006b", keyLabel: "k",
debugName: "Key K"), physicalKey: PhysicalKeyboardKey#700e0(usbHidUsage: "0x000700e0", debugName:
"Control Left")) and its data: RawKeyEventDataLinux(keyLabel: k, keyCode: 75, scanCode: 37,
unicodeScalarValues: 107, modifiers: 0, modifiers down: {})
'package:flutter/src/services/raw_keyboard.dart':
Failed assertion: line 626 pos 12: '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._handleKeyEvent (package:flutter/src/services/raw_keyboard.dart:626:12)
#3      BasicMessageChannel.setMessageHandler.<anonymous closure> (package:flutter/src/services/platform_channel.dart:73:49)
#4      BasicMessageChannel.setMessageHandler.<anonymous closure> (package:flutter/src/services/platform_channel.dart:72:47)
#5      _DefaultBinaryMessenger.handlePlatformMessage (package:flutter/src/services/binding.dart:284:33)
#6      _invoke3.<anonymous closure> (dart:ui/hooks.dart:221:15)
#10     _invoke3 (dart:ui/hooks.dart:220:10)
#11     PlatformDispatcher._dispatchPlatformMessage (dart:ui/platform_dispatcher.dart:457:7)
#12     _dispatchPlatformMessage (dart:ui/hooks.dart:90:31)
(elided 5 frames from class _AssertionError and dart:async)
════════════════════════════════════════════════════════════════════════════════════════════════════

Another exception was thrown: 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#1a171(logicalKey: LogicalKeyboardKey#0006b(keyId: "0x0000006b", keyLabel: "k", debugName: "Key K"), physicalKey:
PhysicalKeyboardKey#700e0(usbHidUsage: "0x000700e0", debugName: "Control Left")) and its data: RawKeyEventDataLinux(keyLabel: k, keyCode: 75, scanCode: 37, unicodeScalarValues: 107,
modifiers: 0, modifiers down: {})

Another exception was thrown: 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#4d584(logicalKey: LogicalKeyboardKey#0006b(keyId: "0x0000006b", keyLabel: "k", debugName: "Key K"), physicalKey:
PhysicalKeyboardKey#700e0(usbHidUsage: "0x000700e0", debugName: "Control Left")) and its data: RawKeyEventDataLinux(keyLabel: k, keyCode: 75, scanCode: 37, unicodeScalarValues: 107,
modifiers: 0, modifiers down: {})