Closed dad72 closed 4 years ago
@dad72 Thanks for this. I didn't realize keyCode and charCode were obsolete Code is much cleaner now :) Did this solve your "Z" problem?
In fact as I explained in the comments, the jump happens when I release SHIFT.
I have to face Z + SHIFT + SPACE and release SHIFT and skip this product. Otherwise I use TAB which locks "run", then only Z and space to jump (it works.)
Hi,
Several small changes for the detection of keyboard keys. No need for keyCode and fromCharCode
Directly use e.key which allows you to obtain the SPACE, SHIFT and TAB keys and the others (without capital letters). Simpler for users / players.
I put everything in a switch (e.key) because faster.
All that is set function public set***Code(code: number) becomes useless.
In addition it seems to me that keyCode and fromCharCode become obsolete or the sound already.
I test is everything works.