mirror of
https://github.com/OpenCut-app/OpenCut.git
synced 2026-07-13 21:52:53 +02:00
refactor: remove keyboard shortcuts for better integration later
This commit is contained in:
@@ -341,34 +341,6 @@ export function Timeline() {
|
|||||||
return () => window.removeEventListener("keydown", handleKeyDown);
|
return () => window.removeEventListener("keydown", handleKeyDown);
|
||||||
}, [redo]);
|
}, [redo]);
|
||||||
|
|
||||||
// Keyboard shortcuts for snapping
|
|
||||||
useEffect(() => {
|
|
||||||
const handleKeyDown = (e: KeyboardEvent) => {
|
|
||||||
// Don't trigger when typing in input fields or textareas
|
|
||||||
if (
|
|
||||||
e.target instanceof HTMLInputElement ||
|
|
||||||
e.target instanceof HTMLTextAreaElement
|
|
||||||
) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Only trigger when timeline is focused or mouse is over timeline
|
|
||||||
if (
|
|
||||||
!isInTimeline &&
|
|
||||||
!timelineRef.current?.contains(document.activeElement)
|
|
||||||
) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (e.key === "s" || e.key === "S") {
|
|
||||||
e.preventDefault();
|
|
||||||
toggleSnapping();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
window.addEventListener("keydown", handleKeyDown);
|
|
||||||
return () => window.removeEventListener("keydown", handleKeyDown);
|
|
||||||
}, [toggleSnapping, isInTimeline]);
|
|
||||||
|
|
||||||
// Old marquee system removed - using new SelectionBox component instead
|
// Old marquee system removed - using new SelectionBox component instead
|
||||||
|
|
||||||
const handleDragEnter = (e: React.DragEvent) => {
|
const handleDragEnter = (e: React.DragEvent) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user