Closed Bug 432533 Opened 16 years ago Closed 16 years ago

two mac key tests fail on Mac OS X 10.5

Categories

(Core :: Widget: Cocoa, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: jaas, Assigned: kinetik)

Details

Attachments

(1 file, 2 obsolete files)

Two tests in test_keycodes.xul fail on Mac OS X.

    // ... and a Greek accesskey!
    testKey({layout:"Greek", keyCode:0, ctrl:1, chars:"\u0001", unmodifiedChars:"\u03b1"},
            "\u03b1", true);
    testKey({layout:"Greek", keyCode:0, ctrl:1, chars:"\u0001", unmodifiedChars:"\u03b1"},
            "\u0391", true);
Ctrl+foo key returns Latin alphabets/numeric/some symbol. We should return the same keys at Meta pressing. But now, we only returns:

Ctrl+alphabet -> alphabet (ignoring CapsLock!)
Ctrl+numeric -> numeric only when ctrl+numeric sends to numeric us by OS.
Ctrl+symbol (e.g., semicolon) -> symbol only when Ctrl+symbol sends to symbol us by OS.
Attached patch patch v1 (obsolete) — Splinter Review
Fix tests on 10.5 by allowing tests to select a key layout via the TIS API rather than always using the current key layout.
Attached patch patch v2 (obsolete) — Splinter Review
Unbitrot, use C++ style casts, also force keyboard to ANSI when a keyboard layout override is in use.
Assignee: joshmoz → kinetik
Attachment #320095 - Attachment is obsolete: true
Status: NEW → ASSIGNED
Attachment #320239 - Flags: superreview?(roc)
Attachment #320239 - Flags: review?(joshmoz)
> +        kt.mUchr.mKbType = gOverrideKeyboardLayout ? 40 : ::LMGetKbdType();

I think that gOverrideKeyboardLayout can be zero now. (the keyboard layout ID of US is zero.) I think that we need another flag for checking this.
Good point, thanks!  I wouldn't have noticed this because my current keyboard is US.  I'll post a new patch shortly.
Attachment #320239 - Flags: superreview?(roc)
Attachment #320239 - Flags: review?(joshmoz)
Attached patch patch v3Splinter Review
Turn gOverrideKeyboardLayout into a pair which holds the layout ID and a bool indicating whether the override is active.  The override is active while SynthesizeNativeKeyEvents is on the stack, with the current overriding layout dependent on the top-most SynthesizeNativeKeyEvents call.  If we need to handle reentrancy where the override must be disabled while SythesizeNativeKeyEvents is on the stack, more work will need to be done--I couldn't think of a case where this matters, but feel free to point out I'm wrong!

Rewrite GetInputSourceIDFromKeyboardLayout to look up input source IDs via the KLS and TIS APIs rather than using a hardcoded table.  This works by finding the UCHR for the desired keyboard layout using the older ScriptManager/KLS layout ID using the KLS API, then searches the list of TIS input sources for an input source with the same UCHR.  Clunky, but I couldn't find a way to look up layouts by ScriptManager/KLS layout IDs using the TIS APIs.

Rebased against current trunk and all tests in test_keycodes.xul pass.
Attachment #320239 - Attachment is obsolete: true
Attachment #320286 - Flags: superreview?(roc)
Attachment #320286 - Flags: review?(joshmoz)
Attachment #320286 - Flags: review?(joshmoz) → review+
Attachment #320286 - Flags: superreview?(roc) → superreview+
Comment on attachment 320286 [details] [diff] [review]
patch v3

Requesting a1.9+.  Change is low risk since it only changes behaviour in code used by mochitests.
Attachment #320286 - Flags: approval1.9?
Comment on attachment 320286 [details] [diff] [review]
patch v3

a1.9+=damons
Attachment #320286 - Flags: approval1.9? → approval1.9+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: