Skip to content

Commit

Permalink
fix: android input, Backspace and Enter (rustdesk#9782)
Browse files Browse the repository at this point in the history
Signed-off-by: fufesou <[email protected]>
  • Loading branch information
fufesou authored Oct 30, 2024
1 parent 0f5f9f6 commit e6c5064
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions flutter/lib/models/input_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -556,13 +556,14 @@ class InputModel {
// The correct PhysicalKeyboardKey should be
// PhysicalKeyboardKey#e14a9(usbHidUsage: "0x00070028", debugName: "Enter")
// https://github.com/flutter/flutter/issues/157771
final isKeyMatch =
isIOS || isAndroid && e.logicalKey.debugName == e.physicalKey.debugName;
// We cannot use the debugName to determine the key is correct or not, because it's null in release mode.
// to-do: `isLegacyModeKeys` is not the best workaround, we need to find a better way to fix this issue.
final isLegacyModeKeys = ['Backspace', 'Enter'].contains(e.logicalKey.keyLabel);
final isMobileAndPeerNotAndroid =
isMobile && peerPlatform != kPeerPlatformAndroid;
final isDesktopAndMapMode =
isDesktop || isWebDesktop && keyboardMode == kKeyMapMode;
if (isKeyMatch && (isMobileAndPeerNotAndroid || isDesktopAndMapMode)) {
if (!isLegacyModeKeys && (isMobileAndPeerNotAndroid || isDesktopAndMapMode)) {
// FIXME: e.character is wrong for dead keys, eg: ^ in de
newKeyboardMode(
e.character ?? '',
Expand Down

0 comments on commit e6c5064

Please sign in to comment.