What is an NVDA Object?
An NVDA Object provides:- Standardized properties: name, role, value, states, description
- Navigation: parent, children, next, previous relationships
- Event handling: Response to focus, value changes, etc.
- Scripting: Custom commands and gesture bindings
- Text access: Through TextInfo objects
Base Class: NVDAObject
TheNVDAObject class is defined in source/NVDAObjects/__init__.py:
NVDAObject base class
API Classes
NVDA supports multiple accessibility APIs through specialized classes:IAccessible Objects
For MSAA/IAccessible controls:IAccessible Example
UI Automation Objects
For modern Windows UIA controls:UIA Example
Window Objects
For direct Win32 window access:Window Example
Dynamic Class Creation
One of NVDAโs most powerful features is dynamic class creation. When an object is instantiated:Dynamic class creation flow
This allows NVDA to combine generic API support with application-specific behaviors without modifying core code.
Creating Custom NVDA Objects
Step 1: Define the Class
Inherit from the appropriate base class:Custom NVDA Object
Step 2: Choose When to Use It
In your app module or global plugin:Choosing overlay classes
Common Properties
Essential Properties
Essential properties
Location and Visibility
Location properties
Navigation Properties
Navigation properties
Working with States
States indicate the current condition of a control:Using states
Text Access
NVDA Objects can provide text access:Text access
Custom TextInfo
Custom TextInfo
Focus Redirect
Redirect focus to a different object:Focus redirect
Tree Interceptors
Complex documents can have tree interceptors (like browse mode):Tree interceptor
Practical Example: Custom Button
Complete example of a custom button with enhanced features:Complete custom button example
Best Practices
Property Caching
Property Caching
Properties are cached by default for performance. To disable caching for a specific property:
Overlay Class Order
Overlay Class Order
Classes in
clsList should be ordered from most specific to most general:Memory Management
Memory Management
NVDA uses weak references for object relationships. Donโt store strong references unnecessarily:
API-Specific Properties
API-Specific Properties
Only access API-specific properties when you know the object type:
See Also
Events
Learn about event handling
Scripts & Gestures
Add commands to objects
Writing Plugins
Create app modules and overlays
Architecture Overview
Understand the big picture
