Relative Content

Tag Archive for javascriptkeyboard

Wrong Key Code detected in JavaScript (KeyZ instead of KeyY when Y is pressed)

I’m encountering an issue with keyboard events in JavaScript. When I press the ctrl+shift+y key combination, the event.key property correctly reports Y, but the event.code property incorrectly reports KeyZ. This is unexpected because the physical key being pressed is Y, not Z. This also happens when I just press Y without ctrl/shift.