|
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. |
@@ -173,9 +173,17 @@ def event_UIA_window_windowOpen(self, obj, nextHandler): |
173 | 173 | return |
174 | 174 | # #9104: different aspects of modern input panel are represented by automation iD's. |
175 | 175 | childAutomationID = obj.firstChild.UIAElement.cachedAutomationID |
176 | | - # Emoji panel for build 16299 and 17134. |
| 176 | + # Emoji panel for 1709 (build 16299) and 1803 (17134). |
| 177 | + emojiPanelInitial = winVersion.WIN10_1709 |
177 | 178 | # This event is properly raised in build 17134. |
178 | | - if winVersion.winVersion.build <= 17134 and childAutomationID in ("TEMPLATE_PART_ExpressiveInputFullViewFuntionBarItemControl", "TEMPLATE_PART_ExpressiveInputFullViewFuntionBarCloseButton"): |
| 179 | + emojiPanelWindowOpenEvent = winVersion.WIN10_1803 |
| 180 | + if ( |
| 181 | + winVersion.getWinVer() in (emojiPanelInitial, emojiPanelWindowOpenEvent) |
| 182 | + and childAutomationID in ( |
| 183 | + "TEMPLATE_PART_ExpressiveInputFullViewFuntionBarItemControl", |
| 184 | + "TEMPLATE_PART_ExpressiveInputFullViewFuntionBarCloseButton" |
| 185 | + ) |
| 186 | + ): |
179 | 187 | self.event_UIA_elementSelected(obj.lastChild.firstChild, nextHandler) |
180 | 188 | # Handle hardware keyboard suggestions. |
181 | 189 | # Treat it the same as CJK composition list - don't announce this if candidate announcement setting is off. |
@@ -221,8 +229,9 @@ def event_nameChange(self, obj, nextHandler): |
221 | 229 | or (self._recentlySelected is not None and self._recentlySelected in obj.name)): |
222 | 230 | return |
223 | 231 | # 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. |
| 232 | + if winVersion.getWinVer().build > 17134: |
| 233 | + # In build 17672 and later, |
| 234 | + # return immediately when element selected event on clipboard item was fired just prior to this. |
226 | 235 | # In some cases, parent will be None, as seen when emoji panel is closed in build 18267. |
227 | 236 | try: |
228 | 237 | if obj.UIAElement.cachedAutomationID == "TEMPLATE_PART_ClipboardItemIndex" or obj.parent.UIAElement.cachedAutomationID == "TEMPLATE_PART_ClipboardItemsList": return |
|
0 commit comments