Welcome to Software Development on Codidact!
Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.
Comments on A keydown event succeeds for an English letter but not for an Hebrew one, sharing the same key
Post
A keydown event succeeds for an English letter but not for an Hebrew one, sharing the same key
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