event.keyCode support in MS EDGE browser

Geetha Ganesan 0 Reputation points
2024-07-29T09:58:10.4566667+00:00

I have come across an article on keyCode in MDN and it states that this feature is deprecated and no longer recommended.

 KeyboardEvent: keyCode property - Web APIs | MDN (mozilla.org)

 In our application we widely use the event.keyCode syntax in JavaScript code (client-side script) and we would like to know whether that code could be retained as such (as its working currently in MS EDGE browser) but we don’t know whether it would be supported in future MS EDGE browsers based on the below article.

 What’s MS stand on this and do you have any roadmap to remove this feature in future from MS EDGE browsers?

Microsoft Edge
Microsoft Edge
A Microsoft cross-platform web browser that provides privacy, learning, and accessibility tools.
2,357 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. ShiJieLi-MSFT 10,196 Reputation points Microsoft Vendor
    2024-07-30T03:46:53.8466667+00:00

    Hi @Geetha Ganesan ,

    Unfortunately, Microsoft so far hasn't released a roadmap for the deprecation. keyCode seems not to be deprecated for some while.

    However, we still do not recommend using keyCode just as the documentation says. Please avoid using it, and update existing code if possible. Even though there could be a roadmap before its official deprecation, it is better to prepare for it from now on. Just to name a few, alternatives you can migrate to are key and code properties.


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    Best Regards,

    Shijie Li

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.