ctrlKey event

13 views
Skip to first unread message

joao carlos Grabois

unread,
Nov 16, 2019, 6:04:33 AM11/16/19
to CreateJS Discussion
How can I use ctrlKey events in a container?

Dan Zen

unread,
Nov 16, 2019, 8:38:05 AM11/16/19
to CreateJS Discussion

I don't think CreateJS captures key events with the on method (but I could be wrong) - so use

window.addEventListener("keydown", function(e) {
  if (e.ctrlKey) {}
  // you also have e.keyCode for the key code.
});

In ZIM we wrap that in the Frame:
frame.on("keydown", ...etc

joao carlos Grabois

unread,
Nov 20, 2019, 3:38:07 AM11/20/19
to CreateJS Discussion
thank you for confirming my suspicion.
Reply all
Reply to author
Forward
0 new messages