|
1 | 1 | # App module for Composable Shell (CShell) input panel |
2 | | -#A part of NonVisual Desktop Access (NVDA) |
3 | | -#Copyright (C) 2017-2018 NV Access Limited, Joseph Lee |
4 | | -#This file is covered by the GNU General Public License. |
5 | | -#See the file COPYING for more details. |
| 2 | +# A part of NonVisual Desktop Access (NVDA) |
| 3 | +# Copyright (C) 2017-2021 NV Access Limited, Joseph Lee |
| 4 | +# This file is covered by the GNU General Public License. |
| 5 | +# See the file COPYING for more details. |
6 | 6 |
|
7 | 7 | """App module for Windows 10 Modern Keyboard aka new touch keyboard panel. |
8 | 8 | The chief feature is allowing NVDA to announce selected emoji when using the keyboard to search for and select one. |
@@ -175,7 +175,13 @@ def event_UIA_window_windowOpen(self, obj, nextHandler): |
175 | 175 | childAutomationID = obj.firstChild.UIAElement.cachedAutomationID |
176 | 176 | # Emoji panel for build 16299 and 17134. |
177 | 177 | # This event is properly raised in build 17134. |
178 | | - if winVersion.winVersion.build <= 17134 and childAutomationID in ("TEMPLATE_PART_ExpressiveInputFullViewFuntionBarItemControl", "TEMPLATE_PART_ExpressiveInputFullViewFuntionBarCloseButton"): |
| 178 | + if ( |
| 179 | + winVersion.getWinVer().build <= 17134 |
| 180 | + and childAutomationID in ( |
| 181 | + "TEMPLATE_PART_ExpressiveInputFullViewFuntionBarItemControl", |
| 182 | + "TEMPLATE_PART_ExpressiveInputFullViewFuntionBarCloseButton" |
| 183 | + ) |
| 184 | + ): |
179 | 185 | self.event_UIA_elementSelected(obj.lastChild.firstChild, nextHandler) |
180 | 186 | # Handle hardware keyboard suggestions. |
181 | 187 | # Treat it the same as CJK composition list - don't announce this if candidate announcement setting is off. |
@@ -221,8 +227,9 @@ def event_nameChange(self, obj, nextHandler): |
221 | 227 | or (self._recentlySelected is not None and self._recentlySelected in obj.name)): |
222 | 228 | return |
223 | 229 | # The word "blank" is kept announced, so suppress this on build 17666 and later. |
224 | | - if winVersion.winVersion.build > 17134: |
225 | | - # In build 17672 and later, return immediatley when element selected event on clipboard item was fired just prior to this. |
| 230 | + if winVersion.getWinVer().build > 17134: |
| 231 | + # In build 17672 and later, |
| 232 | + # return immediately when element selected event on clipboard item was fired just prior to this. |
226 | 233 | # In some cases, parent will be None, as seen when emoji panel is closed in build 18267. |
227 | 234 | try: |
228 | 235 | if obj.UIAElement.cachedAutomationID == "TEMPLATE_PART_ClipboardItemIndex" or obj.parent.UIAElement.cachedAutomationID == "TEMPLATE_PART_ClipboardItemsList": return |
|
0 commit comments