Skip to content

Commit

Permalink
Add repeat-last-action hotkey
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanielrindlaub committed Dec 5, 2023
1 parent 5fbd8e9 commit 320d284
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/features/loupe/Loupe.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,7 @@ const Loupe = () => {
.toLocaleString(DateTime.DATETIME_MED_WITH_SECONDS);

// Listen for hotkeys
// TODO: should this all live in the ImageReviewToolbar?
// TODO: use react synthetic onKeyDown events instead?
const reviewMode = useSelector(selectReviewMode);
const isAddingLabel = useSelector(selectIsAddingLabel);
Expand Down Expand Up @@ -286,6 +287,14 @@ const Loupe = () => {
dispatch(addLabelStart('to-all-objects'));
}

// ctrl-v (repeat last action)
if (((e.ctrlKey || e.metaKey) && charCode === 'v') &&
hasRole(userRoles, WRITE_OBJECTS_ROLES)) {
e.stopPropagation();
handleRepeatAction();
}


// // handle ctrl-a (add object)
// if (reviewMode) {
// let charCode = String.fromCharCode(e.which).toLowerCase();
Expand Down

0 comments on commit 320d284

Please sign in to comment.