Side navigation
#11963 closed enhancement (plugin)
Opened June 23, 2012 01:21PM UTC
Closed June 23, 2012 01:25PM UTC
Last modified June 25, 2012 11:25AM UTC
Add a list of constants for event.which or .keyCode
Reported by: | ubershmekel | Owned by: | |
---|---|---|---|
Priority: | undecided | Milestone: | None |
Component: | unfiled | Version: | git |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
E.g. spacebar, pagedown, enter, etc. These are all buttons commonly used that are coded with magic numbers (e.g. 32 instead of SPACE_KEYCODE, or 38 instead of ARROW_UP) all over the web. I think it would be nice if there was a way to standardize this instead of having to use a "cheat-sheet" e.g. http://mikemurko.com/general/jquery-keycode-cheatsheet/ to read such code.
I understand certain browsers have different conventions for these http://unixpapa.com/js/key.html but perhaps a function for normalization of keycodes can be added as well.
Attachments (0)
Change History (2)
Changed June 23, 2012 01:25PM UTC by comment:1
resolution: | → plugin |
---|---|
status: | new → closed |
Changed June 25, 2012 11:25AM UTC by comment:2
jQuery UI provides a list of common key codes: https://github.com/jquery/jquery-ui/blob/4aafdfd10b8d29288a81ca7a40d22d5bd5954a92/ui/jquery.ui.core.js#L26
This would be great for a plugin, but would all a lot of bytes to core for something that isn't needed by everyone.