The default bug view has changed. See this FAQ.

Cmd + Opt + something shortcut keys don't work in "Dvorak - Qwerty ⌘" keyboard layout

RESOLVED FIXED in mozilla14

Status

()

Core
Widget: Cocoa
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: Jason Garber, Assigned: masayuki)

Tracking

Trunk
mozilla14
x86
Mac OS X
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [key hell])

Attachments

(2 attachments, 2 obsolete attachments)

(Reporter)

Description

5 years ago
Created attachment 605723 [details]
Dvorak-Qwerty Firefox bug.m4v

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

5 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

5 years ago
Assignee: nobody → masayuki
(Assignee)

Updated

5 years ago
Status: NEW → ASSIGNED
(Assignee)

Comment 1

5 years ago
Created attachment 606187 [details] [diff] [review]
Patch

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

5 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

5 years ago
Attachment #606187 - Flags: review?(smichaud)
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

5 years ago
karlt:

Would you check the patch for feedback? I'd like to land this ASAP due to the risk.
Looks like this code was added in http://hg.mozilla.org/mozilla-central/rev/9515fda788fd (bug 432388).  Still making sense of it.
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

5 years ago
Created attachment 610429 [details] [diff] [review]
Patch

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

5 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 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

5 years ago
Created attachment 610749 [details] [diff] [review]
Patch

Thanks.
Attachment #610429 - Attachment is obsolete: true
Attachment #610429 - Flags: review?(karlt)
Attachment #610749 - Flags: review?(karlt)
Attachment #610749 - Flags: review?(karlt) → review+
(Assignee)

Comment 11

5 years ago
https://hg.mozilla.org/integration/mozilla-inbound/rev/31f1d027a49f
Target Milestone: --- → mozilla14
https://hg.mozilla.org/mozilla-central/rev/31f1d027a49f
Status: ASSIGNED → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.