Created
February 25, 2019 17:42
-
-
Save codeofdusk/a5d5f44f942fe8b41f3517f99964d40a to your computer and use it in GitHub Desktop.
An NVDA global plugin to test UI Automation support.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import api | |
import globalPluginHandler | |
from scriptHandler import script | |
import ui | |
uiaState = False | |
uiaApp = None | |
focus = None | |
old = None | |
def force(hwnd): | |
"Always returns True." | |
return True | |
class GlobalPlugin(globalPluginHandler.GlobalPlugin): | |
@script(gesture="kb:NVDA+alt+u") | |
def script_toggleForceUIAutomation(self, gesture): | |
global uiaState, uiaApp, old | |
focus = api.getFocusObject() | |
if not uiaState: | |
uiaApp = focus.appModule | |
old = uiaApp.isGoodUIAWindow | |
uiaApp.isGoodUIAWindow = force | |
uiaState = True | |
ui.message("UI automation forceably enabled") | |
else: | |
uiaApp.isGoodUIAWindow = old | |
uiaState = False | |
ui.message("UI automation override disabled") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment