refactor(commands): centralize command ids
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import type { Dispatch } from "@commands/dispatcher";
|
||||
import { commandIds } from "@commands/ids";
|
||||
import type { GlobalKeybindConsumer, KeybindEvent } from "./keyboard";
|
||||
import type { GlobalPointerConsumer, PointerInputEvent } from "./pointer";
|
||||
import { createViewportPointerPanHandler } from "./viewport";
|
||||
@@ -31,13 +32,13 @@ export function createViewportPanInputController(options: {
|
||||
if (options.globalKeyConsumer(event)) return true;
|
||||
if (event.code !== "Space") return false;
|
||||
|
||||
options.dispatch("tool.enterTemporaryPan", undefined);
|
||||
options.dispatch(commandIds.toolEnterTemporaryPan, undefined);
|
||||
return true;
|
||||
},
|
||||
keyUp(event) {
|
||||
if (event.code !== "Space") return false;
|
||||
|
||||
options.dispatch("tool.exitTemporaryPan", undefined);
|
||||
options.dispatch(commandIds.toolExitTemporaryPan, undefined);
|
||||
return true;
|
||||
},
|
||||
pointerDown: pointerPan.pointerDown,
|
||||
|
||||
Reference in New Issue
Block a user