Repository: flutter
Issue: Keyboard shortcuts not working with fcitx
Labels: a: text input,engine,a: accessibility,platform-web,platform-linux,has reproducible steps,P2,found in release: 2.0,found in release: 2.1,team-web,triaged-web

<!-- Thank you for using Flutter!

     If you are looking for support, please check out our documentation
     or consider asking a question on Stack Overflow:
      * https://flutter.dev/
      * https://api.flutter.dev/
      * https://stackoverflow.com/questions/tagged/flutter?sort=frequent

     If you have found a bug or if our documentation doesn't have an answer
     to what you're looking for, then fill out the template below. Please read
     our guide to filing a bug first: https://flutter.dev/docs/resources/bug-reports
-->

## Steps to Reproduce

<!-- You must include full steps to reproduce so that we can reproduce the problem. -->

1. Run `flutter create bug`.
2. Update the `main.dart` file as follows: 
```Dart
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  MyHomePage({Key key, this.title}) : super(key: key);
  final String title;

  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  int _counter = 0;

  void _incrementCounter() {
    setState(() {
      _counter++;
    });
  }

  @override
  Widget build(BuildContext context) {
    return FocusableActionDetector(
      shortcuts: <LogicalKeySet, Intent>{
        LogicalKeySet(LogicalKeyboardKey.alt, LogicalKeyboardKey.keyK):
            const CountUpIntent(),
      },
      child: Actions(
        actions: <Type, Action<Intent>>{
          CountUpIntent: CallbackAction<CountUpIntent>(
            onInvoke: (CountUpIntent intent) {
              return setState(
                () {
                  _counter++;
                },
              );
            },
          ),
        },
        child: Scaffold(
          appBar: AppBar(
            title: Text(widget.title),
          ),
          body: Center(
            child: Column(
              mainAxisAlignment: MainAxisAlignment.center,
              children: <Widget>[
                TextField(),
                Text(
                  'You have pushed the button this many times:',
                ),
                Text(
                  '$_counter',
                  style: Theme.of(context).textTheme.headline4,
                ),
              ],
            ),
          ),
          floatingActionButton: FloatingActionButton(
            onPressed: _incrementCounter,
            tooltip: 'Increment',
            child: Icon(Icons.add),
          ),
        ),
      ),
    );
  }
}

class CountUpIntent extends Intent {
  const CountUpIntent();
}

```
3. Run `flutter run -d chrome`
4. Focus the text field
5. Press `Alt + K`
6. Switch to Chinese input using fcitx (Google Pinyin)
7. Press `Alt + K`
8. Type something in Chinese
9. Press `Alt + K`
10. Switch back to German input
11. Press `Alt + K`

**Expected results:** <!-- what did you want to see? -->
The counter gets incremented with every use of `Alt + K`.

**Actual results:** <!-- what did you see? -->
At step 5: The counter goes up.
At step 7: The counter goes up.
At step 8: The text is shown as [tofu](https://www.google.com/get/noto/) for about a second before correctly displaying the Chinese characters. Adding more text displays the characters right away, without tofu.
At step 9: The counter doesn't got up.
At step 11: The counter doesn't go up.

<details>
  <summary>Logs</summary>

<!--
      Run your application with `flutter run --verbose` and attach all the
      log output below between the lines with the backticks. If there is an
      exception, please see if the error message includes enough information
      to explain how to solve the issue.
-->

`flutter run --verbose` shows no output for the described steps.

```
Operating System: Manjaro Linux
KDE Plasma Version: 5.21.1
KDE Frameworks Version: 5.79.0
Qt Version: 5.15.2
Kernel Version: 5.10.18-1-MANJARO
OS Type: 64-bit
Graphics Platform: X11
Processors: 4 × Intel® Core™ i7-7500U CPU @ 2.70GHz
Memory: 15.5 GiB of RAM
Graphics Processor: Mesa Intel® HD Graphics 620
```


<!-- Finally, paste the output of running `flutter doctor -v` here. -->

```
[✓] Flutter (Channel beta, 2.0.0, on Linux, locale de_DE.UTF-8)
    • Flutter version 2.0.0 at /home/felipe/flutter
    • Framework revision 60bd88df91 (vor 3 Tagen), 2021-03-03 09:13:17 -0800
    • Engine revision 40441def69
    • Dart version 2.12.0

[!] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
    • Android SDK at /home/felipe/Android/Sdk
    • Platform android-30, build-tools 29.0.2
    • Java binary at: /usr/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.10+9)
    ✗ Android license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.
      See https://flutter.dev/docs/get-started/install/linux#android-setup for more details.

[✓] Chrome - develop for the web
    • CHROME_EXECUTABLE = /usr/bin/google-chrome-stable

[!] Android Studio (not installed)
    • Android Studio not found; download from https://developer.android.com/studio/index.html
      (or visit https://flutter.dev/docs/get-started/install/linux#android-setup for detailed instructions).

[✓] Connected device (1 available)
    • Chrome (web) • chrome • web-javascript • Google Chrome 88.0.4324.182

! Doctor found issues in 2 categories.
```

</details>