79289022

Date: 2024-12-17 18:45:59
Score: 2
Natty:
Report link

Way too complicated. I wonder if this works on the dead keys (`~^'"). This is the easy way:

var charCode = event.key.charCodeAt(0); var character = String.fromCharCode(charCode);

You also have to realise that String.fromCharCode(event.keyCode) is very wrong. A charCode is not the same as a keyCode.

Reasons:
  • Low length (0.5):
  • No code block (0.5):
  • Low reputation (1):
Posted by: oyosoftware