-
-
Notifications
You must be signed in to change notification settings - Fork 663
/
Copy pathputty.py
34 lines (29 loc) · 1.13 KB
/
putty.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# appModules/putty.py
# A part of NonVisual Desktop Access (NVDA)
# This file is covered by the GNU General Public License.
# See the file COPYING for more details.
# Copyright (C) 2010-2019 NV Access Limited, Bill Dengler
"""App module for PuTTY"""
import oleacc
from NVDAObjects.behaviors import KeyboardHandlerBasedTypedCharSupport, Terminal
from NVDAObjects.window import DisplayModelEditableText, DisplayModelLiveText
import appModuleHandler
from NVDAObjects.IAccessible import IAccessible
from winVersion import getWinVer, WIN10_1607
class AppModule(appModuleHandler.AppModule):
# Allow this to be overridden for derived applications.
TERMINAL_WINDOW_CLASS = "PuTTY"
def chooseNVDAObjectOverlayClasses(self, obj, clsList):
if (
obj.windowClassName == self.TERMINAL_WINDOW_CLASS
and isinstance(obj, IAccessible)
and obj.IAccessibleRole == oleacc.ROLE_SYSTEM_CLIENT
):
try:
clsList.remove(DisplayModelEditableText)
except ValueError:
pass
if getWinVer() >= WIN10_1607:
clsList[0:0] = (KeyboardHandlerBasedTypedCharSupport, DisplayModelLiveText)
else:
clsList[0:0] = (Terminal, DisplayModelLiveText)