def terminate():\r
winInputHook.terminate()\r
\r
+def getInputHkl():\r
+ """Obtain the hkl currently being used for input.\r
+ This retrieves the hkl from the thread of the focused window.\r
+ """\r
+ focus = api.getFocusObject()\r
+ if focus:\r
+ thread = focus.windowThreadID\r
+ else:\r
+ thread = 0\r
+ return winUser.user32.GetKeyboardLayout(thread)\r
+\r
class KeyboardInputGesture(inputCore.InputGesture):\r
"""A key pressed on the traditional system keyboard.\r
"""\r
\r
if 32 < self.vkCode < 128:\r
return unichr(self.vkCode).lower()\r
- vkChar = winUser.user32.MapVirtualKeyW(self.vkCode, winUser.MAPVK_VK_TO_CHAR)\r
+ vkChar = winUser.user32.MapVirtualKeyExW(self.vkCode, winUser.MAPVK_VK_TO_CHAR, getInputHkl())\r
if vkChar>0:\r
return unichr(vkChar).lower()\r
\r
ext = False\r
elif len(keyName) == 1:\r
ext = False\r
- requiredMods, vk = winUser.VkKeyScan(keyName)\r
+ requiredMods, vk = winUser.VkKeyScanEx(keyName, getInputHkl())\r
if requiredMods & 1:\r
keys.append((winUser.VK_SHIFT, False))\r
if requiredMods & 2:\r
if not user32.PostMessageW(hwnd, msg, wParam, lParam):\r
raise WinError()\r
\r
-user32.VkKeyScanW.restype = SHORT\r
-def VkKeyScan(ch):\r
- res = user32.VkKeyScanW(WCHAR(ch))\r
+user32.VkKeyScanExW.restype = SHORT\r
+def VkKeyScanEx(ch, hkl):\r
+ res = user32.VkKeyScanW(WCHAR(ch), hkl)\r
if res == -1:\r
raise LookupError\r
return res >> 8, res & 0xFF\r
- When disabling automatic checking for updates, NVDA no longer has to be restarted in order for the change to fully take effect.\r
- NVDA no longer fails to start if an add-on cannot be removed due to its directory currently being in use by another application. (#2860)\r
- Tab labels in DropBox's preferences dialog can now be seen with Flat Review.\r
+- If the input language is changed to something other than the default, NVDA now detects keys correctly for commands and input help mode.\r
\r
\r
== Changes for Developers ==\r