Overview
Braille display drivers enable NVDA to communicate with braille displays, allowing blind users to read screen content in braille. Each driver handles the specific protocol and hardware interface for a particular manufacturer’s displays.Driver Architecture
Base Class
All braille drivers inherit frombraille.BrailleDisplayDriver. This provides the core framework for:
- Device detection and connection
- Braille cell rendering
- Input handling (keys, routing buttons, wheels)
- Configuration management
Key Components
- Device Communication: Uses
hwIomodule for hardware I/O operations - Protocol Implementation: Packet-based communication with displays
- Input Mapping: Translates hardware inputs to NVDA gestures
- Cell Translation: Converts Unicode braille to device-specific formats
Creating a Basic Driver
Minimal Driver Structure
Here’s the simplest possible braille driver:brailleDisplayDrivers/noBraille.py
Required Attributes
str
required
Unique identifier for the driver (should match the module filename)
str
required
Human-readable name shown in NVDA’s braille display settings
bool
default:"False"
Whether the driver can be used safely from background threads
bool
default:"False"
Whether the driver supports automatic USB/Bluetooth detection
Full Driver Implementation
Freedom Scientific Example
The Freedom Scientific driver demonstrates a complete implementation:Device Initialization
Protocol Implementation
Packet Structure
Most braille displays use packet-based protocols:Writing to Display
Cell Translation
Some displays use non-standard dot mappings:Input Handling
Key Gestures
Gesture Mapping
Automatic Detection
USB Detection
Advanced Features
Status Cells
Some displays have dedicated status cells:Configuration Settings
Testing Your Driver
Debug Logging
Manual Testing
1
Install the driver
Place your driver file in
source/brailleDisplayDrivers/yourdriver.py2
Restart NVDA
Restart NVDA or reload plugins (NVDA+Control+F3)
3
Select your driver
Open NVDA Settings > Braille and select your driver from the list
4
Test functionality
- Verify cell output displays correctly
- Test all buttons and gestures
- Check routing buttons work
- Verify automatic detection (if supported)
Best Practices
Thread Safety
Mark
isThreadSafe = True if your driver uses proper locking and can handle concurrent callsError Handling
Always handle connection errors gracefully and clean up resources in
terminate()Timeout Management
Use appropriate timeouts to prevent NVDA from freezing if the device becomes unresponsive
Translation Tables
Cache translation tables - don’t regenerate them for every cell update
Common Issues
Device Not Detected
- Verify USB/Bluetooth IDs are correct
- Check device drivers are installed
- Ensure
registerAutomaticDetection()is implemented - Test with manual port selection first
Garbled Braille Output
- Check if device uses non-standard dot mapping
- Verify cell translation table is correct
- Ensure byte order matches device expectations
Input Not Working
- Verify packet parsing is correct
- Check gesture IDs match NVDA’s expectations
- Ensure
InputGesture.sourceis set correctly - Test with NVDA input logging enabled
Reference
Key Modules
braille: Base braille display driver frameworkhwIo: Hardware I/O for serial, USB, HID communicationbdDetect: Braille display automatic detectioninputCore: Input gesture handlingbrailleInput: Braille keyboard input support
Example Drivers
Study these drivers insource/brailleDisplayDrivers/ for reference:
freedomScientific.py: Full-featured driver with complex protocolalva.py: Driver with automatic detectionnoBraille.py: Minimal driver structurehidBrailleStandard.py: HID-based braille standard protocol
Developer Guide
See the NVDA Developer Guide for more information on plugin development
