Closed Bug 1528943 Opened 5 years ago Closed 5 years ago

Keyboard events during IME composition should give a special key value on Windows 10 19H1 (and 20H1)

Categories

(Core :: Widget: Win32, defect, P1)

All
Windows 10
defect

Tracking

()

VERIFIED FIXED
mozilla67
Tracking Status
firefox66 --- verified
firefox67 --- verified

People

(Reporter: saschanaz, Assigned: masayuki)

Details

(Keywords: inputmethod, Whiteboard: [qa-triaged])

Attachments

(1 file)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:67.0) Gecko/20100101 Firefox/67.0

Steps to reproduce:

  1. Access https://codepen.io/SaschaNaz/full/YBBMxq
  2. Type かく ('kaku' in QWERTY) via Windows Japanese IME
  3. Press ArrowDown and then ArrowUp
  4. Check the result

Actual results:

kakuArrowDownArrowUp

Expected results:

Chrome: ProcessProcessProcessProcessProcessProcess
Edge: UnidentifiedUnidentifiedUnidentifiedUnidentifiedUnidentified

The current Firefox behavior currently causes conflicts with IME word candidate selection on web pages (including Google and DuckDuckGo) where pressing arrow keys moves focus.

Component: Untriaged → DOM: Events
Product: Firefox → Core

I cannot reproduce the issue on Nightly67.0a1 Windows10 and MS-IME.
Nightly67.0a1 displays "ProcessProcessProcessProcessProcessProcess"

Keywords: inputmethod

Ah, I tried again and it seems this is specific to Windows 10 19H1 (and 20H1) preview branches. The stable version of Firefox also behaves same way there. Filed https://aka.ms/AA4c3zk

OS: Unspecified → Windows 10
Summary: Keyboard events during IME composition should give a special key value → Keyboard events during IME composition should give a special key value on Windows 10 19H1 (and 20H1)

Wow, sounds like that TSF stops notifying TSF-aware apps of consuming keys.

Thank you for the report. This is caused by our hidden bug. That is, we still call ImmGetVirtualKey() for trying to retrieve raw virtual keycode value. However, this usage is wrong, see bug 773526. So, we need to stop calling this.

On the other hand, this API behavior is indeed changed starting from 19H1. Therefore, I commented these facts in the FeedbackHub report.

Assignee: nobody → masayuki
Status: UNCONFIRMED → ASSIGNED
Component: DOM: Events → Widget: Win32
Ever confirmed: true
Hardware: Unspecified → All
Version: 67 Branch → Trunk
Priority: -- → P1

We didn't dispatch keyboard events during composition. Therefore, we tried to
retrieve raw virtual keycode value when key messages come with VK_PROCESS
unexpectedly. However, the API, ImmGetVirtualKey(), is not usable for this
purpose because it always returns VK_PROCESS if the key messages have already
been handled by IME. So, we can just stop using it since we need to expose
such key messages as KeyboardEvent whose key value is Process and keyCode
value is DOM_VK_PROCESS.

Pushed by masayuki@d-toybox.com:
https://hg.mozilla.org/integration/autoland/rev/a50238785f3d
Stop trying to retrieve raw keycode value when native virtual keycode is VK_PROCESS r=m_kato
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla67

Comment on attachment 9045544 [details]
Bug 1528943 - Stop trying to retrieve raw keycode value when native virtual keycode is VK_PROCESS

Beta/Release Uplift Approval Request

  • Feature/Bug causing the regression: None
  • User impact if declined: If Firefox 67 isn't released when next Windows 10 update comes and the update does not include a fix of the regression, a lot of web apps handling keydown and/or keyup will be broken when user uses IME.
  • Is this code covered by automated tests?: No
  • Has the fix been verified in Nightly?: Yes
  • Needs manual test from QE?: No
  • If yes, steps to reproduce:
  • List of other uplifts needed: None
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): This was landed a week ago, and this patch just stops calling unnecessary Windows API because the call always overwrites the native keycode value with same value (before Win10 Insider Preview regressed).
  • String changes made/needed: None
Attachment #9045544 - Flags: approval-mozilla-beta?

So, if next Windows 10 update comes after Firefox 67 or Windows 10 update fixes the regression before its release, we don't need to uplift it.

Comment on attachment 9045544 [details]
Bug 1528943 - Stop trying to retrieve raw keycode value when native virtual keycode is VK_PROCESS

Fix for new Windows releases. OK for beta uplift.

Attachment #9045544 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
Flags: qe-verify+
Whiteboard: [qa-triaged]

I reproduced this issue using Fx 67.0a1, build ID: 20190219213951, on Windows 10 x64 19H1.
I can confirm this issue is fixed, I verified using Fx 67.0b7, build ID: 20190331141835 and Fx 66.0.2 build ID: 20190326175229, on Windows 10 x64 19H1.

Status: RESOLVED → VERIFIED
Flags: qe-verify+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: