timoxley / keycode

Convert between keyboard keycodes and keynames and vice versa.
MIT License
455 stars 62 forks source link

keycode(16) returns up-arrow symbol instead of 'shift' #15

Closed greim closed 9 years ago

greim commented 9 years ago

A workaround is possible but code like this is no longer possible:

var pressed = keycode(ev);
if ('shift' === pressed) {
  // do something
}

I can provide a PR later if needed. Re-ordering the codes object literal ought to fix it.

timoxley commented 9 years ago

Yep, I think that's the only solution that will have most minor break to compatibility

timoxley commented 9 years ago

Solved in #16.