Vel Murugan S
Vel Murugan S

Reputation: 580

How to achieve Keyup event in EaselJS

Code to listen keyboard event:

createjs.Ticker.setFPS(30);
createjs.Ticker.addEventListener("tick", this.tick);

Function that triggers on keydown

Solitaire.prototype.tick = function(e) {
   if(key.isPressed('tab')){
       console.log("X");
       //Perform Key Up Action
   }
};

Todo I want to perform some operation when tab key is released ("keyup" in jQuery).

Note: I use keymaster.js to check which key is pressed.

Upvotes: 0

Views: 1145

Answers (1)

user5583935
user5583935

Reputation:

you can use

this.document.onkeyup = keyup;
function keyup(event) {
   /** you can access keyCode to determine which key was pressed**/
   var keyCode =  event.keyCode;
} 

to access and work with keyup even. Tab KeyCode is 9

Upvotes: 2

Related Questions