This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 23943 - It's too difficult to search the code which access KeyboardEvent.key
Summary: It's too difficult to search the code which access KeyboardEvent.key
Status: RESOLVED WONTFIX
Alias: None
Product: WebAppsWG
Classification: Unclassified
Component: HISTORICAL - DOM3 Events (show other bugs)
Version: unspecified
Hardware: All All
: P2 normal
Target Milestone: ---
Assignee: Gary Kacmarcik
QA Contact: public-webapps-bugzilla
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-11-30 03:06 UTC by Masayuki Nakano
Modified: 2014-02-19 01:41 UTC (History)
3 users (show)

See Also:


Attachments

Description Masayuki Nakano 2013-11-30 03:06:10 UTC
I'm working on replacing key names in Firefox with newer WD's key names.

While I'm working on this, I realized that it's difficult to search the code which uses KeyboardEvent.key. The reasons are:

* .key is too generic name.
* Defined key names don't have any mark such as common prefix.

I think that renaming .key may breaks a few web applications which already use .key attribute only on supported browsers.

On the other hand, if we can add common prefix e.g., "KeyName" to the predefined key names, everybody can search such code with using regexp (KeyName[A-Z][a-zA-Z0-9]+).

Additionally, event.key.match() allows to check if the key event is caused by printable key in almost all cases. (If there is no key which inputs "KeyNameFoo"!)

This change may too late. However, at least, it's worthwhile to discuss this issue.
Comment 1 Gary Kacmarcik 2014-02-18 23:50:02 UTC
From our teleconf:
http://www.w3.org/2008/webapps/wiki/21-Jan-2014

Re: 23943, I think it's too late to change the name from 'key' to anything else since there are existing implementations. Although I agree tha the name is unfortunate. Same with 'code'. Sadly the better names like 'keyCode' were already taken.

As for the 'key' values, we did clean them up a bit and added prefixes where they made sense.

You can't search for all the possible 'key' values since they can be any Unicode