Commit 9049f6b1 authored by Ategon's avatar Ategon
Browse files

Separate color pic kevents into two different events

parent 01bf450c
Loading
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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);
+1 −9
Original line number Diff line number Diff line
@@ -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);
    };
+5 −3
Original line number Diff line number Diff line
@@ -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",