New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

onKeyUp event not working #35333

GuillaumeDesforges opened this Issue Dec 6, 2018 · 1 comment


None yet
1 participant

GuillaumeDesforges commented Dec 6, 2018

  • Dart SDK Version: 2.1.0
  • Linux Manjaro
  • Chrome with Webstorm Plugin
<!DOCTYPE html>

    <meta charset="utf-8">
    <link rel="stylesheet" href="styles.css">
    <script defer src="main.dart.js"></script>

<canvas id="canvas" width="800" height="400"></canvas>
import 'dart:html';

void main() {
    window.onKeyUp.listen((KeyboardEvent event) {
        print("Key: " + event.keyCode.toString());

The code above does not work, as it never prints any key code when I release a key.

If I change onKeyUp to onKeyDown everything is fine though.


This comment has been minimized.

GuillaumeDesforges commented Dec 9, 2018

Fixed using this snippet:

GlobalEventHandlers.keyUpEvent.forTarget(document, useCapture: true).listen((e) {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment