2

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?

Manish Wagle
  • 456
  • 2
  • 5
  • 12

1 Answers1

2

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.

smorgan
  • 20,228
  • 3
  • 47
  • 55
  • Is it still the case? – kartik Jul 22 '23 at 15:52
  • @kartik It is always going to be the case; global key event interception is an extremely rare use case, so it's never going to be built into the framework. Anyone in the community is welcome to write and publish a plugin if they want to do so. – smorgan Jul 23 '23 at 16:33