hotkey 0.1.1 copy "hotkey: ^0.1.1" to clipboard
hotkey: ^0.1.1 copied to clipboard

outdatedDart 1 only

A library that enables the binding of hotkeys (keyboard shortcuts) to [Element]'s or [Function]'s.

example/example.dart

import 'package:hotkey/hotkey.dart' as hotkey;
import 'dart:html';

main() {
  querySelectorAll('button').onClick.listen((MouseEvent e) {
    var b = e.target as ButtonElement;
    querySelector('#msg').text = 'Hotkey bound to an element: ${b.text} clicked';
  });
  hotkey.add('a > b > c', () {
    querySelector('#msg').text = 'Hotkey bound to a function: a then b then c';
  });
  hotkey.processAll();
  hotkey.enable();
}
0
likes
40
points
27
downloads

Publisher

unverified uploader

Weekly Downloads

A library that enables the binding of hotkeys (keyboard shortcuts) to [Element]'s or [Function]'s.

Repository (GitHub)
View/report issues

License

BSD-2-Clause (license)

More

Packages that depend on hotkey