globalVars module

global variables module

This module is scheduled for deprecation. Do not continue to add variables to this module.

To retain backwards compatibility, variables should not be removed from globalVars. Instead, encapsulate variables in setters and getters in other modules.

When NVDA core is no longer dependent on globalVars, a deprecation warning should be added to this module which warns developers when importing anything from this module.

Once a warning is in place, after some time it may become appropriate to delete this module.

class globalVars.DefaultAppArgs(**kwargs)

Bases: Namespace

quit: bool = False
check_running: bool = False
logFileName: PathLike | None = ''
logLevel: int = 0
configPath: PathLike | None = None
language: str = 'en'
minimal: bool = False
secure: bool = False

When this is True, NVDA is running in secure mode. This is set to True when NVDA starts with the –secure parameter. This is also set to True when NVDA is running on a secure screen (utils.security.isRunningOnSecureDesktop() returns True) and the serviceDebug parameter is not set. This is forced to true if the forceSecureMode parameter is set.

For more information, refer to projectDocs/design/technicalDesignOverview.md ‘Logging in secure mode’ and the following userGuide sections:

  • SystemWideParameters (information on the serviceDebug and forceSecureMode parameters)

  • SecureMode and SecureScreens

disableAddons: bool = False
debugLogging: bool = False
noLogging: bool = False
changeScreenReaderFlag: bool = True
install: bool = False
installSilent: bool = False
createPortable: bool = False
createPortableSilent: bool = False
portablePath: PathLike | None = None
launcher: bool = False
enableStartOnLogon: bool | None = None
copyPortableConfig: bool = False
easeOfAccess: bool = False
globalVars.desktopObject: NVDAObjects.NVDAObject | None = None

Deprecated, use setDesktopObject|getDesktopObject from api instead

globalVars.foregroundObject: NVDAObjects.NVDAObject | None = None

Deprecated, use setForegroundObject|getForegroundObject from api instead

globalVars.focusObject: NVDAObjects.NVDAObject | None = None

Deprecated, use setFocusObject|getFocusObject from api instead

globalVars.focusAncestors: List[NVDAObjects.NVDAObject] = []

Deprecated, use getFocusAncestors from api instead

globalVars.focusDifferenceLevel: int | None = None

Deprecated, use getFocusDifferenceLevel from api instead

globalVars.mouseObject: NVDAObjects.NVDAObject | None = None

Deprecated, use setMouseObject|getMouseObject from api instead

globalVars.navigatorObject: NVDAObjects.NVDAObject | None = None

Deprecated, use setNavigatorObject|getNavigatorObject from api instead

globalVars.reviewPosition: documentBase.TextContainerObject | None = None

Deprecated, use getReviewPosition|setReviewPosition from api instead

globalVars.reviewPositionObj: NVDAObjects.NVDAObject | None = None

Deprecated, use api.getReviewPosition().obj instead

globalVars.mouseOldX: Literal[None] = None

Deprecated, this is unused and not set by NVDA core

globalVars.mouseOldY: Literal[None] = None

Deprecated, this is unused and not set by NVDA core

globalVars.lastProgressValue: Literal[0] = 0

Deprecated, this is unused and not set by NVDA core

globalVars.startTime: float = 0.0

Deprecated, use NVDAState.getStartTime instead

globalVars.exitCode: int = 0

Deprecated, this should not be used by add-on authors. NVDA core should use NVDAState._getExitCode|_setExitCode instead.

globalVars.appPid: int = 0

The process ID of NVDA itself.

globalVars.appDir: str = 'C:\\nvda\\source'

The directory where NVDA is installed or running from. Set by nvda_slave.pyw and nvda.pyw.