C'è anche quella possibilità con JS puoi gestire le coordinate x,y del puntatore sullo screen; ma cominciamo ad andare su una cosa che non potrei darti così sul momento.
Puoi anche fare un secondo pulsante =>> di spostamento maggiore (+10px/click).
Ma avevo anche realizzato un bel joystick con dei timer in passato; prova questo, e a trattenere il pulsante mezzo secondo ... :
codice:
var L = 0;
var TR;
var TRC;
function moveRight(){
L++;
document.getElementById("area").style.marginLeft = L +"px";
TR=setTimeout('moveRightContinuos();', 500);
}
function moveRightPlus(){
L=L+10;
document.getElementById("area").style.marginLeft = L +"px";
TR=setTimeout('moveRightContinuos();', 500);
}
function moveRightContinuos(){
L++;
document.getElementById("area").style.marginLeft = L +"px";
TRC=setTimeout('moveRightContinuos();', 15);
}
//i comandi nel BODY:
<input value="=>" type="button" onmousedown='moveRight();'
onmouseup='clearTimeout(TR); clearTimeout(TRC);'>
<input value="=>>" type="button" onmousedown='moveRightPlus();'
onmouseup='clearTimeout(TR); clearTimeout(TRC); alert("stopped");'>