A port of Keypress.js to Dart