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

161
Views
Evento de teclado JS keydown a Unicode

Estoy tratando de capturar la entrada del usuario (para el campo de entrada personalizado que no es html), así que necesito la clave hexadecimal unicode del carácter de entrada

Otras respuestas sugieren algo como esto:

 function detectkey(event) { var unicode = event.which || event.keyCode; document.getElementById("keystroke").innerHTML = "The pressed key was: " + String.fromCharCode(unicode) +"<br>The Unicode value is:"+ unicode; }

Pero tanto event.which como event.keyCode y también charCode son pruebas obsoletas:

  • https://developer.mozilla.org/en-US/docs/Web/API/UIEvent/which
  • https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/keyCode
  • https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/charCode

Como puede ver aquí https://keycode.info/ Quedan 2 formas: event.key y event.code

  • Pero event.key te da 'shift', 'control' y otras cosas
  • Y event.code es una broma
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Maldita sea, parece que necesito usar el evento de keypress de tecla en su lugar. No te da pulsaciones de control

UPD: Maldita sea * 2, también está obsoleto

https://developer.mozilla.org/en-US/docs/Web/API/Document/keypress_event

about 4 years ago · Juan Pablo Isaza Report
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!