I can control my bot through web. These are its url-
I am using html button to do this. But I want to control it with "arrow" key of keyboard. My idea is if I press and hold up arrow key then the bot will go forward(https://172.0.0.1/forward) and if I release the up arrow key then the bot will Stop(https://172.0.0.1/stop) going. and the same thing to
I'm not familiar with JavaScript Can you please help me...
try like this.
window.addEventListener('keydown',function(event){
if(event.keyCode===37) { //left
}
if(event.keyCode===38) { //up
}
if(event.keyCode===39) { //right
}
if(event.keyCode===40) { //down
}
});
UPDATE
window.addEventListener('keyup',function(event){
// do something
});