8000 fix(ui): handle multiple shortcut registrations by aarthificial · Pull Request #1165 · motion-canvas/motion-canvas · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

fix(ui): handle multiple shortcut registrations #1165

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions packages/ui/src/components/viewport/Coordinates.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import {isInspectable, Vector2} from '@motion-canvas/core';
import {useEffect, useState} from 'react';
import {useViewportContext} from '../../contexts';
import {useShortcut, VIEWPORT_SHORTCUTS} from '../../contexts/shortcuts';
import {
useShortcut,
useViewportContext,
VIEWPORT_SHORTCUTS,
} from '../../contexts';
import {useCurrentScene, useViewportMatrix} from '../../hooks';
import {ReadOnlyInput} from '../controls';
import styles from './Viewport.module.scss';
Expand Down
3 changes: 2 additions & 1 deletion packages/ui/src/contexts/shortcuts.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -431,8 +431,9 @@ export function useShortcuts<T extends string>(
if (typeof result === 'object') {
return result;
}
return true;
}
return true;
return false;
};

callbackSet.add(handler);
Expand Down
Loading
0