bindKey static method
Binds the handler
to be invoked on the key
presses.
Implementation
static Future<void> bindKey(HotKey key, bool Function() handler) async {
if (PlatformUtils.isIOS || PlatformUtils.isAndroid) {
// iOS and Android devices don't support hot keys.
return;
}
try {
await hotKeyManager.register(key, keyDownHandler: (_) => handler());
} catch (e) {
Log.warning('Unable to bind to hot key: $e', 'WebUtils');
}
}