Skip to main content

Overview

App Modules allow you to improve NVDA’s support for specific applications. When an application is running, NVDA automatically loads the corresponding app module and unloads it when the application closes.
App modules are perfect for adding application-specific functionality, customizing how NVDA presents information from an application, or fixing accessibility issues in specific programs.

Basic App Module Structure

App modules must:
  1. Be placed in the appModules directory
  2. Be named after the application’s executable (e.g., notepad.py for notepad.exe)
  3. Define a class called AppModule that inherits from appModuleHandler.AppModule

Naming App Modules

Standard Naming

For most applications, name your app module file after the executable:
  • notepad.exenotepad.py
  • explorer.exeexplorer.py
  • firefox.exefirefox.py
File names containing dots (other than .py) are converted to underscores. For example, my.app.exe would use my_app_exe.py.

Custom Mapping

For executables with names that conflict with Python naming rules or when you want to map multiple executables to one app module, use a global plugin to register the mapping:
registrationPlugin.py

Handling Events

App modules can respond to events that occur in their application. Events are methods named event_eventName.

Common Events

method
Object gained keyboard focus
method
Object lost keyboard focus
method
Focus moved inside a container object (the object is an ancestor of the focus)
method
Object became the new foreground/active top-level object
method
Object’s name changed
method
Object’s value changed
method
Object’s state changed
method
Caret (insertion point) moved within the object

Creating Scripts

Scripts are commands that users can execute via keyboard shortcuts. Use the @script decorator to define scripts:
scripts.py

Script Decorator Parameters

str
required
User-visible description shown in Input Gestures dialog
str
Category to group similar scripts (defaults to “Miscellaneous”)
str
Single gesture string (e.g., "kb:NVDA+shift+v")
list[str]
Multiple gesture strings
bool
default:"False"
Whether script applies to focus ancestor objects
bool
default:"False"
Run script even when input help is active
bool
default:"False"
Allow script to run when sleep mode is active

App Module Properties

Essential Properties

properties.py

Sleep Mode

Sleep mode disables NVDA in an application, useful for self-voicing applications:
sleepMode.py
Users can toggle sleep mode with NVDA+Shift+S.

Customizing NVDA Objects

App modules can customize how NVDA Objects behave for specific controls:
customObjects.py

Hosted Apps

Some executables host multiple apps (e.g., javaw.exe, wwahost.exe). For these, you need to:
  1. Name the app module after the hosted app’s internal name
  2. For wwahost.exe, inherit from the wwahost app module

UIA Handling

Control whether to use UI Automation for specific windows:
uiaControl.py

Practical Example

Here’s a complete app module for a custom application:
complete_example.py

Testing

1

Enable scratchpad

Go to NVDA Settings > Advanced and enable the scratchpad directory.
2

Create app module

Place your app module in %APPDATA%\nvda\scratchpad\appModules\.
3

Launch application

Start the target application.
4

Reload plugins

Press NVDA+Control+F3 to reload without restarting NVDA.
5

Test functionality

Test your events, scripts, and customizations.

Best Practices

  • Always call nextHandler() in event methods to propagate events
  • Don’t perform long-running operations in events
  • Use the @script decorator instead of __gestures dictionary
  • Provide clear descriptions for all scripts
  • Test with different NVDA configurations
  • Use ui.message() for user feedback
  • Use log.debug(), log.info(), log.warning() for debugging
  • Check obj.role and obj.windowClassName for object identification
  • Cache expensive computations in instance variables