Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

172
Views
¿Cómo obtener la clave de un evento keydown en el móvil?

Estoy tratando de escuchar un evento keydown y keyup en una aplicación web y necesito recuperar la clave. En el escritorio, esto funciona bien con el siguiente código.

 const inputElement = document.querySelector("input"); const keydownList = document.getElementById("keydownList"); const keyupList = document.getElementById("keyupList"); inputElement.addEventListener("keydown", (e) => { const li = document.createElement("li"); li.innerText = e.key; keydownList.appendChild(li); }); inputElement.addEventListener("keyup", (e) => { const li = document.createElement("li"); li.innerText = e.key; keyupList.appendChild(li); });
 <h2>Input</h2> <input type="text"> <h2>Keydown</h2> <ul id="keydownList"></ul> <h2>Keyup</h2> <ul id="keyupList"></ul>

El problema es que en móvil esto no funciona (al menos yo probé en Android). Firefox solo muestra "Proceso" cada vez en lugar de la clave, y Chrome muestra "No identificado". Lo mismo se aplica a la versión jquery correspondiente del código.

¿Cómo se puede arreglar esto? (He intentado investigar un poco sobre esto, pero no pude encontrar una solución).

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!