Reputation: 26611
Is there a way I can convert a javascript keycode into one that is used by C#?
For example 87 is the character 'w' in javascript, but in C# it's 57. And 77 is 'm' whereas it's 4D in C#. Is there a simple way to convert them? Thanks.
Upvotes: 1
Views: 672
Reputation: 225273
The issue isn't that they're different; your C# ones are just in hexadecimal.
8710 = 5716
7710 = 4D16
Just treat them as int
s, not as strings, and you'll be fine.
Upvotes: 7