diff --git a/packages/client/src/components/CanvasWrapper.tsx b/packages/client/src/components/CanvasWrapper.tsx index c4247d99f8f7da73ab767eda188995799363f88e..449761f0bce2ace6e5e8fe78f7efa5fc3950e2d1 100644 --- a/packages/client/src/components/CanvasWrapper.tsx +++ b/packages/client/src/components/CanvasWrapper.tsx @@ -444,7 +444,7 @@ const CanvasInner = () => { const zoomInSmall = () => zoomBy(KEYBOARD_ZOOM_SMALL_STEP); KeybindManager.on("PIXEL_WHOIS", handlePixelWhois); - KeybindManager.on("PICK_COLOR", handlePickPixel); + KeybindManager.on("PICK_CANVAS_COLOR", handlePickPixel); KeybindManager.on("CAPTURE_CANVAS", captureCanvas); KeybindManager.on("CAPTURE_VIEW", captureView); KeybindManager.on("CAPTURE_REGION", captureRegion); @@ -456,7 +456,7 @@ const CanvasInner = () => { return () => { KeybindManager.off("PIXEL_WHOIS", handlePixelWhois); - KeybindManager.off("PICK_COLOR", handlePickPixel); + KeybindManager.off("PICK_CANVAS_COLOR", handlePickPixel); KeybindManager.off("CAPTURE_CANVAS", captureCanvas); KeybindManager.off("CAPTURE_VIEW", captureView); KeybindManager.off("CAPTURE_REGION", captureRegion); diff --git a/packages/client/src/components/Toolbar/Palette.tsx b/packages/client/src/components/Toolbar/Palette.tsx index aad158533ae734ff43a2e4f12196cb7d8ce796c9..33bd8da581cd22c036ad4653135631cd2c0d0327 100644 --- a/packages/client/src/components/Toolbar/Palette.tsx +++ b/packages/client/src/components/Toolbar/Palette.tsx @@ -465,15 +465,7 @@ export const Palette = () => { PaletteLib.swapSelectedColors(); }; - const handlePickColorKeybind = ({ - clientX, - clientY, - }: { - clientX: number; - clientY: number; - }) => { - if (clientX >= 0 && clientY >= 0) return; - + const handlePickColorKeybind = () => { setPickColorPreview(null); setPickColorMode(true); }; diff --git a/packages/client/src/lib/keybinds.ts b/packages/client/src/lib/keybinds.ts index 15a0742f5972816e79b39cbaf5a8779a0870d1f2..8d7f101a4b289b445ae7b60d4ca95bfda6d8ef34 100644 --- a/packages/client/src/lib/keybinds.ts +++ b/packages/client/src/lib/keybinds.ts @@ -174,9 +174,6 @@ const KEYBINDS = enforceObjectType({ }, ], PICK_COLOR: [ - { - key: "MCLICK", - }, { key: "KeyC", ctrl: false, @@ -185,6 +182,11 @@ const KEYBINDS = enforceObjectType({ shift: false, }, ], + PICK_CANVAS_COLOR: [ + { + key: "MCLICK", + }, + ], MOD_SELECT: [ { key: "LCLICK",