Ver Mensaje Individual
  #4 (permalink)  
Antiguo 22/09/2010, 12:28
Avatar de Adler
Adler
Colaborador
 
Fecha de Ingreso: diciembre-2006
Mensajes: 4.671
Antigüedad: 17 años, 4 meses
Puntos: 126
Respuesta: Teclado con Javascript

Hola

Algo así
Código Javascript:
Ver original
  1. function keyPressed(e){
  2. thisKey= (document.all)?e.keyCode: e.which; // ASCII
  3. if (thisKey==49){ document.location.href='verde.htm'; return false;} // 1
  4. if (thisKey==50){ document.location.href='rojo.htm'; return false;} // 2
  5. ........
  6. alert("Ha pulsado la tecla "+thisKey+", escriba el código para manejar esa tecla");
  7. }
Suerte
__________________
Los formularios se envían/validan con un botón Submit
<input type="submit" value="Enviar" style="background-color:#0B5795; font:bold 10px verdana; color:#FFF;" />