simple_keyboard_listener 1.0.1
simple_keyboard_listener: ^1.0.1 copied to clipboard
A widget that trigger an action when given keys are pressed
A simple keyboard listener widget #
This Simple keyboard listener widget allow you to easily call a function when a key has been detected
-
Customizable ! Just provide a list of LogicalKeyboardKey to filter keys to detect
-
It can't be easier to use :
SimpleKeyboardListener(
keys: [
LogicalKeyboardKey.space,
],
onPressed: (e) => log('You pressed ${e.label}'),
child: Image.network('https://picsum.photos/250?image=9')
);
This example will print You pressed Space in your console whenever you typed the space keyboard key
By default all keyboard keys are listened.