Introducing Dart: Handle Key Press Events | packtpub.com

547 views · Published 4 August 2015 · 2:16 · Indexed 10 November 2026

Channel: Packt · 2015 · Science & Technology

Watch on YouTube

Part of 'Introducing Dart' video series. For full Course visit:
http://bit.ly/1M8sW2M

Right now, we have no way for the user to control the game. We will use the onKeyPress() method provided by the dart:html:Document object to handle key press events and make the DOM react. 
• Just like as the timer, we need to create a callback function. It will be called every time the user presses a key. It will add a paragraph element to the game board 
• We will register this callback function with the DOM using the document.onKeyPress() method 
• We will run our project and verify that each time a key is pressed, a paragraph element is added to our board element 


For the latest web development video tutorials, please visit
http://bit.ly/1KYwKQ5

Find us on Facebook -- http://www.facebook.com/Packtvideo
Follow us on Twitter - http://www.twitter.com/packtvideo

More from this channel