How to cancel events like keypress, keyDown, ... from one key and activate them in another

Asked

Viewed 58 times

0

I have been playing a flash game in the browser for a long time, and recently I acquired a notebook with a very different keyboard and wondered if I could have a Javascript script that I could run on the console that would 'change' the keys. For example, when I press the keys WSAD it would be as if I had pressed the arrow keys.

Just to illustrate...

trocar(A, B) {

cancelarEventoDe(A);

ativarEventoDe(B);

}
  • 1

    I believe the Flash takes over events. So I think, as long as the focus is on the Flash component, all and any UI management Javascript is ignored. I can’t talk for sure, though.

  • I found another topic that possibly solves my problem, I can’t test it now. It is a script with jQuery, https://answall.com/questions/126326/como-simular-um-pressing-de-teclas-com-jquery

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.