Context-Sensitive Bindings
Context-sensitive bindings allow different button mappings depending on which Slicer module is currently active.
How It Works
When you press a button, MouseMaster:
Detects the currently active Slicer module
Checks for a context-specific binding for that module
If found, uses the context binding
Otherwise, uses the default binding
Example: The Back button could trigger Undo in most modules, but switch to “Previous Segment” when in Segment Editor.
Setting Up Context Bindings
Open the Button Mappings section
Check “Enable context-sensitive bindings”
Select a context from the dropdown (e.g., “Segment Editor”)
Configure button mappings for that context
Repeat for other modules as needed
Supported Contexts
MouseMaster recognizes these Slicer modules for context bindings:
Module |
Context ID |
Typical Use Case |
|---|---|---|
Segment Editor |
|
Segmentation workflows |
Markups |
|
Fiducial and curve placement |
Volume Rendering |
|
3D visualization |
Models |
|
Surface model viewing |
Transforms |
|
Transform editing |
Default |
(fallback) |
All other modules |
Example Configuration
A segmentation-focused preset might have:
Default bindings:
Back: Undo
Forward: Redo
Thumb: Toggle Crosshair
Segment Editor overrides:
Back: Previous Segment
Forward: Next Segment
Thumb: Toggle Paint/Erase
This way, your familiar undo/redo shortcuts work everywhere, but in Segment Editor you get quick segment navigation.
Best Practices
Keep defaults intuitive: Use common actions (undo, redo) as defaults
Override sparingly: Only add context bindings where truly needed
Group related actions: Put segment operations on adjacent buttons
Test thoroughly: Switch between modules to verify bindings work
Preset Format
Context bindings are stored in the contextMappings section of presets:
{
"mappings": {
"back": {"action": "edit_undo"},
"forward": {"action": "edit_redo"}
},
"contextMappings": {
"SegmentEditor": {
"back": {"action": "segment_previous"},
"forward": {"action": "segment_next"}
},
"Markups": {
"back": {"action": "markups_delete_point"},
"forward": {"action": "markups_place_fiducial"}
}
}
}
See Also
Button Mapping - Configure individual buttons
Presets - Save context-sensitive configurations
Available Actions - Complete action reference