Search code examples
flutterflutter-desktop

Listen to key press outside of flutter (desktop) app


I have managed to print the key the user presses when the user is using the app. But How to print the key (listen to key press) in flutter desktop when the user is not using the app or in background?


Solution

  • Flutter doesn't provide APIs for intercepting key events at the OS level. You would need to write native code for each platform you want to run on to do that, and use platform channels to communicate the information to your Dart code.