Bug Tracker

Modify

Ticket #11963 (closed enhancement: plugin)

Opened 12 months ago

Last modified 12 months ago

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:
Blocking: Blocked by:

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.

Change History

comment:1 Changed 12 months ago by dmethvin

  • Status changed from new to closed
  • Resolution set to plugin

This would be great for a plugin, but would all a lot of bytes to core for something that isn't needed by everyone.

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.