Added back ctrl+r as rotate if on desktop (#5982) (#5993)

Fix #5982

Behaviour of ctrl+r altered to support rotate on desktop, while the web
version continue to use refresh as default.
This commit is contained in:
Matheus Saito
2026-04-01 11:48:53 +01:00
committed by GitHub
parent c31e4253dd
commit 212f12a81f
3 changed files with 40 additions and 8 deletions
@@ -0,0 +1,20 @@
import { useViewer } from "@app/contexts/ViewerContext"
import { useCallback } from "react";
export function useViewerKeyCommand(): (event: KeyboardEvent) => boolean {
const { rotationActions } = useViewer();
return useCallback((event:KeyboardEvent): boolean => {
switch (event.key) {
case 'r':
case 'R':
event.preventDefault();
if (event.shiftKey) {
rotationActions.rotateBackward();
} else {
rotationActions.rotateForward();
}
return true;
}
return false;
}, [rotationActions]);
}