Closed
Bug 735648
Opened 13 years ago
Closed 13 years ago
Cmd + Opt + something shortcut keys don't work in "Dvorak - Qwerty ⌘" keyboard layout
Categories
(Core :: Widget: Cocoa, defect)
Tracking
()
RESOLVED
FIXED
mozilla14
People
(Reporter: jg, Assigned: masayuki)
Details
(Whiteboard: [key hell])
Attachments
(2 files, 2 obsolete files)
1.01 MB,
application/octet-stream
|
Details | |
6.80 KB,
patch
|
karlt
:
review+
|
Details | Diff | Splinter Review |
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:11.0) Gecko/20100101 Firefox/11.0
Build ID: 20120312181643
Steps to reproduce:
Mac OS X has a keyboard layout called "Dvorak - Qwerty ⌘" where the keys are ordinarily in the Dvorak layout, but when the ⌘ (Command) key is held down, it temporarily switches back to Qwerty. Thus, you can type text in Dvorak, but all the keyboard shortcuts in your muscle memory still work.
While using he Dvorak-Qwerty ⌘ layout, I attempted to trigger the Web Developer: Inspect menu item with shortcut key Opt-Cmd-I.
Actual results:
The tools menu highlights briefly (but does not open), but the Inspect mode is not triggered.
Expected results:
The inspect mode should have started. Note that if I first click on the Tools menu, the keyboard shortcut works as expected.
Assignee | ||
Updated•13 years ago
|
Status: UNCONFIRMED → NEW
Component: Untriaged → Widget: Cocoa
Ever confirmed: true
Product: Firefox → Core
QA Contact: untriaged → cocoa
Summary: Some shortcut keys don't work in "Dvorak - Qwerty ⌘" keyboard layout → Cmd + Opt + something shortcut keys don't work in "Dvorak - Qwerty ⌘" keyboard layout
Whiteboard: [key hell]
Version: 11 Branch → Trunk
Assignee | ||
Updated•13 years ago
|
Assignee: nobody → masayuki
Assignee | ||
Updated•13 years ago
|
Status: NEW → ASSIGNED
Assignee | ||
Comment 1•13 years ago
|
||
tryserver builds:
https://ftp.mozilla.org/pub/mozilla.org/firefox/try-builds/masayuki@d-toybox.com-9579ab1bf9a6/
This patch depends on the patches of bug 479942 and others.
Assignee | ||
Comment 2•13 years ago
|
||
Comment on attachment 606187 [details] [diff] [review]
Patch
I think that this is a mistake.
|!isDvorakQWERTY| means we don't need to append altCharCodes for Dvorak-Qwerty because charCode and cmdedChar (or cmdedShiftChar) must be same. But there is the case Alt key is pressed (Mac's Alt key is similar to AltGr of other platforms).
So, if cmdedChar or cmdedShiftChar doesn't match to the charCode, we should append them.
Attachment #606187 -
Flags: feedback?(karlt)
Assignee | ||
Updated•13 years ago
|
Attachment #606187 -
Flags: review?(smichaud)
Comment 3•13 years ago
|
||
Comment on attachment 606187 [details] [diff] [review]
Patch
I haven't tested this. But it looks like it shouldn't do harm.
Attachment #606187 -
Flags: review?(smichaud) → review+
Assignee | ||
Comment 4•13 years ago
|
||
karlt:
Would you check the patch for feedback? I'd like to land this ASAP due to the risk.
Comment 5•13 years ago
|
||
Looks like this code was added in http://hg.mozilla.org/mozilla-central/rev/9515fda788fd (bug 432388). Still making sense of it.
Comment 6•13 years ago
|
||
Comment on attachment 606187 [details] [diff] [review]
Patch
It doesn't feel right to me to add the Qwerty alternative char codes when
!isMeta, because we have already included the Dvorak char codes.
For other isCmdSwitchLayout layouts, don't we still want to include
cmdedChar when preferredCharCode is cmdedShiftChar?
>+ // cmdedChar or comdedShiftChar, we don't need to do it.
Please fix up comded here.
Attachment #606187 -
Flags: feedback?(karlt) → feedback-
Assignee | ||
Comment 7•13 years ago
|
||
Did you mean this?
Comparing charCode makes it more complicated. Therefore, I removed it. It shouldn't be an issue for performance.
Attachment #606187 -
Attachment is obsolete: true
Attachment #610429 -
Flags: review?(karlt)
Assignee | ||
Comment 8•13 years ago
|
||
Ah, note that the new patch includes the change for bug 677252 for new tests because the bug is still blocked by bug 447757. But this bug should go first.
Comment 9•13 years ago
|
||
Comment on attachment 610429 [details] [diff] [review]
Patch
>+ bool isCmdPressedOnDvorakQWERTY = aKeyEvent.isMeta && isDvorakQWERTY;
>+
>- if ((unshiftedChar || shiftedChar) &&
>- (!aKeyEvent.isMeta || !isDvorakQWERTY)) {
>+ if ((unshiftedChar || shiftedChar) && !isCmdPressedOnDvorakQWERTY) {
>- // Latin char for the key. But don't append at Dvorak-QWERTY.
>- if ((cmdedChar || cmdedShiftChar) && isCmdSwitchLayout && !isDvorakQWERTY) {
>+ if ((cmdedChar || cmdedShiftChar) && isCmdSwitchLayout &&
>+ (!isDvorakQWERTY || isCmdPressedOnDvorakQWERTY)) {
Yes, this logic looks good to me, but I don't think the boolean isCmdPressedOnDvorakQWERTY is helping here.
I would just leave the first test as is and use (!isDvorakQWERTY || aKeyEvent.isMeta) in the second, or perhaps swap the order of the variables in one of the tests to be consistent.
Assignee | ||
Comment 10•13 years ago
|
||
Thanks.
Attachment #610429 -
Attachment is obsolete: true
Attachment #610429 -
Flags: review?(karlt)
Attachment #610749 -
Flags: review?(karlt)
Updated•13 years ago
|
Attachment #610749 -
Flags: review?(karlt) → review+
Assignee | ||
Comment 11•13 years ago
|
||
Target Milestone: --- → mozilla14
Comment 12•13 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•