canvasman Posted December 9, 2018 Share Posted December 9, 2018 In the keyboard event, what property would suit best for game hotkeys? I am thinking about using event.key property. It would be very convenient since no need to do number to character conversions unlike event.keyCode but is there any drawbacks I am not aware of why it would not suit well for games? I still see a lot of event.keyCode used even though its deprecated, will it be dropped? Share your thoughts? thanks Quote Link to comment Share on other sites More sharing options...
mattstyles Posted December 9, 2018 Share Posted December 9, 2018 Its about support. `keyCode` is supported everywhere (although deprecated in some browsers), `key` is only a working draft and not supported everywhere. https://caniuse.com/#search=KeyboardEvent This is incredibly reliable for support matrices. canvasman 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.