Closed Bug 105990 Opened 19 years ago Closed 6 years ago
_ENTER is indistinguishable from VK _RETURN
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)?
unfortunately right now, you can't distinguish between them because it would cause too many other bugs.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Assignee: joki → saari
QA Contact: trix → ian
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
(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
Use KeyboardEvent.location or KeyboardEvent.code. -> INVA
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → INVALID
Component: Event Handling → User events and focus handling
You need to log in before you can comment on or make changes to this bug.