I am building a Tetris game in javaScript. I am trying to make it playable even on an android phone, so I added four arrow buttons like this:
<button onclick="rightArrow()">→</button>
I have four functions (triggered by keyboard) like this one:
function right () {
// Move brick to the right
}
Is there a way to call the right() function again and again when user holds the button until he let it go? I found several similar questions here and elsewhere, but the answers were above my level of javaScript knowledge. I am not using jQuery. My game is here.