Closed
Bug 48951
Opened 24 years ago
Closed 4 months ago
Need to use VK_ keyCode constants in .js files
Categories
(Core :: DOM: UI Events & Focus Handling, defect, P3)
Tracking
()
RESOLVED
WONTFIX
Future
People
(Reporter: aaronlev, Unassigned)
Details
(Keywords: helpwanted, Whiteboard: [keybnd][wgate])
From Bugzilla Helper:
User-Agent: Mozilla/4.0 (compatible; MSIE 5.0; Windows 98; DigExt)
BuildID: 200073008
Right now, people are using hard coded constants for keyCode.
For example, if (keyCode==13) {dosomething();}
That's not good! Should be able to say if (keyCode==VK_ENTER) ...
Reproducible: Always
Steps to Reproduce:
1. Try to use any VK_ or DOM_VK constant, it doesn't work.
2.
3.
Actual Results: -
Expected Results: -
-
Comment 1•24 years ago
|
||
I'll take this one -- it's related to some other work I'm doing.
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Target Milestone: --- → M19
Reassigning to akkana.
Assignee: joki → akkana
Status: ASSIGNED → NEW
Comment 3•24 years ago
|
||
It turns out that most of these are already available, in MouseKeyEvent.idl. I
have a fix in my tree (awaiting review and XP testing of a bunch of other
associated changes) which makes the NS_VK_* symbols in nsGUIEvent.h dependant on
the dom versions of the same symbols (which in turn are generated from
MouseKeyEvent.idl), so we'll only have one master copy of the keycode list.
Status: NEW → ASSIGNED
Comment 4•24 years ago
|
||
The symbols come from MouseKeyEvent.idl. The fix I mentioned to reconcile the
symbols in widget has been checked in. In theory, you should be able to use the
VK_ symbols from JS. In practice, I haven't had a chance to test this. Someone
please try it and see if it works!
Reporter | ||
Comment 5•24 years ago
|
||
Akkana, I've just tested this with a cvs build from after your last report. I
see that DOM_VK_blah are all defined in MouseKeyEvent.idl, but I get a
Javascript 'symbol undefined' error when I try to use one of them. Is there
some statement I need in the javascript to make those .idl definitions
available?
Comment 6•24 years ago
|
||
The fix to dom/public/idl/events/MouseKeyEvent.idl won't go into the tree,
as the rest of dom/public/idl.
The results of idlc need to be generated and checked in, to get this into the
build.
Are those names defined in DOM3? I just saw links to the first public
working draft on w3.org, but those aren't public yet. (access denied).
Adding jst and vidur for insight in dom standards and building wisdom
Axel
Comment 9•24 years ago
|
||
Reassigning QA Contact for all open and unverified bugs previously under Lorca's
care to Gerardo as per phone conversation this morning.
QA Contact: lorca → gerardok
Updated•24 years ago
|
Whiteboard: [keybnd]
Updated•23 years ago
|
QA Contact: madhur → rakeshmishra
Updated•22 years ago
|
QA Contact: rakeshmishra → trix
Updated•15 years ago
|
QA Contact: trix → events
Comment 11•7 years ago
|
||
Akkana, are you still working on this?
Also, it seems .keyCode is deprecated.
Flags: needinfo?(akkzilla)
Comment 12•7 years ago
|
||
No, sorry, I don't even have a copy of the codebase any more.
Assignee: akkzilla → nobody
Status: ASSIGNED → NEW
Flags: needinfo?(akkzilla)
Assignee | ||
Updated•6 years ago
|
Component: Event Handling → User events and focus handling
Updated•2 years ago
|
Severity: minor → S4
Comment 14•4 months ago
|
||
Ideally (if we need to keep using .keyCode
in our tree), yes. However, in most cases, we should use .key
and as far as I know, new frontend code uses .key
. Therefore, I think that we should switch from .keyCode
to .key
rather than updating .keyCode
comparisons.
Anyway, this kind of bug is not useful because most developers update such code when they touch without blocking this bug. Let's close this.
Status: NEW → RESOLVED
Closed: 4 months ago
Flags: needinfo?(masayuki)
Resolution: --- → WONTFIX
You need to log in
before you can comment on or make changes to this bug.
Description
•