Skip to content
This repository has been archived by the owner on Mar 1, 2024. It is now read-only.

Added check if KeyboardEvent.keyCode deprecated then use KeyboardEvent.code + mapping instead. #48

Merged
merged 1 commit into from
Nov 24, 2022

Conversation

lukehb
Copy link
Contributor

@lukehb lukehb commented Nov 24, 2022

I "fixed" this by adding a check to see if KeyboardEvent.keyCode is not present, if so, I use KeyboardEvent.code. This change ends up sending the exact same keyCodes as before because I created a mapping from KeyboardEvent.code to KeyboardEvent.keyCode. This will mean the deprecated method will continue to be used and the codepath will be exactly the same as it has been until such a time when the browsers actually remove KeyboardEvent.keyCode and then this new code will execute.

This means no change at all on the UE side!

…t.Code - this required a lookup table as we still send keyCode in both cases.
@lukehb
Copy link
Contributor Author

lukehb commented Nov 24, 2022

This PR addresses #46

Copy link
Collaborator

@Belchy06 Belchy06 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants