Skip to content

Commit

Permalink
Bug 1528943 - Stop trying to retrieve raw keycode value when native v…
Browse files Browse the repository at this point in the history
…irtual keycode is VK_PROCESS r=m_kato

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`.

Differential Revision: https://phabricator.services.mozilla.com/D20623

UltraBlame original commit: a50238785f3d0db6c47a0d8b846f0d3798d6daf5
  • Loading branch information
marco-c committed Oct 4, 2019
1 parent d81a593 commit b5e3c7f
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions widget/windows/KeyboardLayout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1432,14 +1432,11 @@ void NativeKey::InitWithKeyOrChar() {


sLastKeyMSG = mMsg;



if (mMsg.wParam == VK_PROCESSKEY) {
mOriginalVirtualKeyCode =
static_cast<uint8_t>(::ImmGetVirtualKey(mMsg.hwnd));
} else {
mOriginalVirtualKeyCode = static_cast<uint8_t>(mMsg.wParam);
}

mOriginalVirtualKeyCode = static_cast<uint8_t>(mMsg.wParam);



Expand Down

0 comments on commit b5e3c7f

Please sign in to comment.