Skip to content

Keyboard Shortcuts

osdlabel is designed for high-throughput annotation tasks with a comprehensive set of keyboard shortcuts.

KeyAction
vSelect tool
rRectangle tool
cCircle tool
lLine tool
pPoint tool
dPolyline (draw) tool
fFree hand path tool
EscapeDeselect annotation, then deactivate tool
Delete / BackspaceDelete selected annotation
19Activate grid cell by position
= / +Add a grid column
-Remove a grid column
]Add a grid row
[Remove a grid row
KeyAction
EnterFinish as open polyline
cClose as polygon
EscapeCancel polyline in progress
KeyAction
ShiftHold while drawing to produce an open polyline
EscapeCancel stroke in progress

Pass a keyboardShortcuts prop to override any default binding:

<AnnotatorProvider
keyboardShortcuts={{
rectangleTool: 'b', // 'b' for box instead of 'r'
circleTool: 'o', // 'o' for oval instead of 'c'
delete: 'x', // 'x' to delete instead of Delete
}}
>
{/* ... */}
</AnnotatorProvider>

Or via the Annotator component:

<Annotator images={images} contexts={contexts} keyboardShortcuts={{ rectangleTool: 'b' }} />

Unspecified keys keep their default bindings. See KeyboardShortcutMap for all available keys.

Shortcuts are automatically suppressed when focus is in an <input>, <textarea>, or contenteditable element.

For additional suppression logic, use the shouldSkipKeyboardShortcutPredicate prop:

<AnnotatorProvider
shouldSkipKeyboardShortcutPredicate={(target) => {
// Skip shortcuts when focus is inside a modal
return target.closest('.modal') !== null;
}}
>
{/* ... */}
</AnnotatorProvider>