How Events Work
When NVDA detects accessibility events from the operating system or applications, it:- Receives the event from the underlying API (IAccessible, UIA, etc.)
- Abstracts the event into NVDA’s internal format
- Propagates the event through a chain of handlers
- Processes the event to update speech, braille, and UI
Event Propagation Chain
Events propagate through handlers in this order:1
Global Plugins
All loaded global plugins receive the event first
2
App Module
The app module for the object’s application
3
Tree Interceptor
The tree interceptor (like browse mode) if applicable
4
NVDA Object
The NVDA Object itself that triggered the event
Event Method Signatures
On NVDA Objects
When defined directly on an NVDA Object:Event on NVDA Object
On Plugins and App Modules
When defined on global plugins, app modules, or tree interceptors:Event on plugin
Common Events
Focus Events
Focus events
Property Change Events
Property change events
Text and Caret Events
Text and caret events
Window Events
Window events
Selection Events
Selection events
Document Events
Document events
Application Events
Application events
Real-World Examples
Example 1: Beep on Focus Changes
From the NVDA Developer Guide:Notepad beeps
Example 2: Announce Button Presses
Announce button activation
Example 3: Monitor Value Changes
Monitor progress bars
Example 4: Track Focus Entering Dialogs
Dialog tracking
Example 5: Live Region Monitoring
Live region monitoring
Event Timing and Threading
Events are processed on NVDA’s main thread:Event timing
Stopping Event Propagation
Sometimes you want to stop an event from propagating further:Stopping propagation
Event Filtering
Filter events before processing:Event filtering
Custom Events
You can fire custom events:Custom events
Event Queuing
Events are queued to prevent flooding:Event queuing
Debugging Events
Log events for debugging:Event debugging
Performance Considerations
Avoid Expensive Operations
Avoid Expensive Operations
Event handlers should be fast:
Cache Expensive Computations
Cache Expensive Computations
Use properties with caching:
Limit Event Frequency
Limit Event Frequency
Throttle high-frequency events:
Best Practices
- Always call nextHandler() unless you’re intentionally stopping propagation
- Keep handlers fast - use background threads for expensive operations
- Filter early - check conditions before doing work
- Use appropriate event types - don’t handle all events when you need specific ones
- Log for debugging - use log.debug() to trace event flow
- Test thoroughly - events fire frequently, ensure your code is efficient
See Also
NVDA Objects
Learn about the objects that fire events
Scripts & Gestures
Handle user input with scripts
Writing Plugins
Create plugins that handle events
Architecture Overview
Understand the bigger picture
