VK_ENTER is indistinguishable from VK_RETURN

RESOLVED INVALID

Status

()

defect
RESOLVED INVALID
18 years ago
2 months ago

People

(Reporter: nnooiissee, Unassigned)

Tracking

Trunk
mozilla1.2alpha
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

()

Reporter

Description

18 years ago
i am trying to give chatzilla in multiline mode (on mac) functionality like mac
aol instant messanger, using return for \n and enter to send, however both
return and enter are mapped to keyCode 13, and VK_ENTER does not seem to work.

what does VK_ENTER do? what is it supposed to do? is it broken? how can i
differentiate mac return (keyCode 13) from mac enter (should be keyCode 3)?
Reporter

Updated

18 years ago
Blocks: 99586

Comment 1

18 years ago
unfortunately right now, you can't distinguish between them because it would 
cause too many other bugs.
Status: UNCONFIRMED → NEW
Ever confirmed: true

Updated

18 years ago
Target Milestone: --- → mozilla1.2

Updated

17 years ago
QA Contact: madhur → rakeshmishra

Updated

17 years ago
QA Contact: rakeshmishra → trix

Comment 2

16 years ago
.
Assignee: joki → saari
QA Contact: trix → ian

Comment 3

14 years ago
Windows has the same problem -> All.
> differentiate mac return (keyCode 13) from mac enter (should be keyCode 3)?

Actually, the keyCode value should match the W3 values like DOM_VK_RETURN (=13)
and DOM_VK_ENTER (=14).
Hardware: Macintosh → All
Summary: VK_ENTER does not seem to work → VK_ENTER is indistinguishable from VK_RETURN
Assignee: saari → events
Assignee: events → nobody
QA Contact: ian → events

Comment 4

6 years ago
(In reply to Karsten Düsterloh from comment #3)
> Windows has the same problem -> All.
> > differentiate mac return (keyCode 13) from mac enter (should be keyCode 3)?
> 
> Actually, the keyCode value should match the W3 values like DOM_VK_RETURN
> (=13)
> and DOM_VK_ENTER (=14).

Others seem to disagree on this (returning different values), and suggest using KeyboardEvent.location instead to differentiate between VK_RETURN and VK_ENTER:

(In reply to Masayuki Nakano (:masayuki) (Mozilla Japan) from bug 106327, comment #50)
> VK_ENTER must not be used forever because mapping different keyCode values
> to Enter key on standard position and numpad makes web apps broken. For
> example, if numpad's Enter key is mapped to VK_ENTER, it cannot be handled
> by event handlers which only handle VK_RETURN even though they should work
> as same key. If web apps need to know if the pressed key's position, they
> can/should use KeyboardEvent.location. So, DOM Events spec is designed as
> that same function keys must be same information except .location. This
> really does make sense for making key event handlers simple.
xref bug 969247 - DOM_VK_ENTER don't exist anymore

Updated

5 years ago
Blocks: 106327
Use KeyboardEvent.location or KeyboardEvent.code.

-> INVA
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → INVALID
Component: Event Handling → User events and focus handling
Product: Core → Core
You need to log in before you can comment on or make changes to this bug.