Closed
Bug 412627
Opened 17 years ago
Closed 12 years ago
some DOM key events are wrong on OSX
Categories
(Core :: Widget: Cocoa, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: grant_gayed, Assigned: masayuki)
References
()
Details
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 2.0.50727)
Build Identifier: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.4; en-US; rv:1.9b3pre) Gecko/2008011604 Minefield/3.0b3pre
Some key events have incorrect details on OSX. I've verified that these key events are set properly on Windows.
Reproducible: Always
Steps to Reproduce:
1. Go to the url in the url field.
2. Type each of the following keys and note the displayed results:
-> _ (Shift+'-')
-> | (Shift+'\')
-> CapsLock key
-> Help key
-> F13
Actual Results:
-> _ (Shift+'-') has its keycode == 0 in all three events
-> | (Shift+'\') has its keycode == 0 in all three events
-> CapsLock key results in no events at all
-> Help key has its keycode == Insert in the keyup event, and does not trigger either a keydown or keypress event
-> F13 has its keycode == PrintScreen in all three events
Expected Results:
I get the following on Windows:
-> _ (Shift+'-') has keycode == 109 in keyup and keydown
-> | (Shift+'\') has keycode == 220 in keyup and keydown
-> CapsLock key has keycode == 20 in keyup and keydown
-> Help key is N/A
-> F13 is N/A
Assignee | ||
Comment 1•12 years ago
|
||
(In reply to Grant Gayed from comment #0)
> Actual Results:
> -> _ (Shift+'-') has its keycode == 0 in all three events
Now, the keyCode must be DOM_VK_HYPHEN_MINUS (0xAD (173)).
> -> | (Shift+'\') has its keycode == 0 in all three events
Now, the keyCode must be DOM_VK_BACK_SLASH (0xDC (220)).
> -> CapsLock key results in no events at all
CapsLock always causes only keydown event on Mac because we cannot know the keyup timing by the design of Cocoa event model. The keyCode must be DOM_VK_CAPS_LOCK (0x14 (20))
> -> Help key has its keycode == Insert in the keyup event, and does not
> trigger either a keydown or keypress event
I don't test Help key actually. But the keyCode value is intentional because when you connect a PC keyboard to your Mac, Insert key should be work as Help key.
http://mxr.mozilla.org/mozilla-central/source/widget/cocoa/TextInputHandler.mm#1204
> -> F13 has its keycode == PrintScreen in all three events
This is intentional too for same reason.
http://mxr.mozilla.org/mozilla-central/source/widget/cocoa/TextInputHandler.mm#1179
However, these two are not good behavior in semantics. So, perhaps, KeyboardEvent.key will return "Help" and "F13" for them.
> Expected Results:
> I get the following on Windows:
> -> _ (Shift+'-') has keycode == 109 in keyup and keydown
This value is changed by bug 630810
Assignee: nobody → masayuki
Status: UNCONFIRMED → RESOLVED
Closed: 12 years ago
Component: Shell Integration → Widget: Cocoa
Depends on: 677252
Product: Firefox → Core
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•