+1

Is it possible to use these keyboard event listeners without using an input field, and to call specific functions based on the k

I am trying to make a Tetris game without buttons, just keyboard controls, however, I am having difficulties doing this without an input field like demonstrated here: https://www.w3schools.com/jsref/event_onkeypress.asp Here is my code: https://code.sololearn.com/WcT7LGC7moHS/#html Ignore the comments and code under the body tag.

3/10/2019 5:06:17 PM

Fleet

2 Answers

New Answer

+2

Very nice game btw. But that won't work on mobiles and tablets since they need an input field to pop up the soft-keyboard

0

I appreciate the compliment, however, this is not my code. I am simply trying to make the gameplay faster and more authentic to modern Tetris by using keyboard controls. I can't take credit for someone else's code. That's not right.