A keydown event succeeds for an English letter but not for an Hebrew one, sharing the same key
+5
−1
I am trying to listen to the event in which the keyboard key containing the Hebrew final-letter ך
is pressed.
This key stands for both the English letter L
and the Hebrew final letter ך
.
If my operating system works in English mode, the following code works for L
, but if I change the language mode to Hebrew, the code doesn't work for ך
.
window.addEventListener('keydown', function(event) {
if (event.ctrlKey && event.altKey && event.key === 'l' || event.ctrlKey && event.altKey && event.key === 'ך') {
document.querySelector(".cbntphone_icon").style.display = "none";
}
});
There is no error in the browser console when I click CTRL+ALT+ך
.
Why would the code work only for the English letter?
3 comment threads