Skip to content
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

Need an option to define custom action when double clicking on a Image #991

Closed
Zeus64 opened this issue Feb 28, 2021 · 2 comments
Closed

Comments

@Zeus64
Copy link

Zeus64 commented Feb 28, 2021

In setting we can define what to do when we scroll the wheel but nothing to define what to do when we double click on the image. Personally I would like to define an option like : "open image location & close ImageGlass" when I double click on the image (instead of the actual behavior to set the image at full size).

@Zeus64 Zeus64 changed the title Need an option to define custom action when clicking / double clicking on a Image Need an option to define custom action when double clicking on a Image Feb 28, 2021
@fire-eggs
Copy link
Collaborator

Mickey Nmickeysworkemail@gmail.com Apr 19, 2021, 10:17:32 PM (2 days ago)
to ImageGlass Community
Is there a way to change double click behavior when viewing an image? I would like it to go to full screen and hide the toolbar. Double clicking again would return to windowed with toolbar.

@d2phap d2phap added this to the v9.0 beta 2 milestone May 21, 2022
@d2phap
Copy link
Owner

d2phap commented Sep 6, 2022

v9.0 beta 2 adds support for mouse action customization with this setting:

Example 1:

Left double-click to open image location and exit the app:

// in igconfig.json file

"MouseClickActions": {
  "LeftDoubleClick": {
    "ToggleOn": {
      "Executable": "IG_OpenLocation",
      // action can be chained
      "NextAction": {
        "Executable": "IG_Exit",
      }
    }
  }
},

Example 2:

  • First left double-click to view actual size of the image.
  • Second left double-click to set the zoom back to Auto zoom.
// in igconfig.json file

"MouseClickActions": {
  "RightDoubleClick": {
    // first click to set zoom to 100%
    "ToggleOn": {
      "Executable": "IG_SetZoom",
      "Arguments": "1"
    },

    // second click to set zoom value to Auto zoom's value
    "ToggleOff": {
      "Executable": "IG_SetZoomMode",
      "Arguments": "AutoZoom"
    }
  }
},

Example 3:

  • First left double-click to enter full screen and hide toolbar.
  • Second left double-click to exit full screen and show toolbar.
// in igconfig.json file

"MouseClickActions": {
  "LeftDoubleClick": {
    "ToggleOn": {
      "Executable": "MnuFullScreen",
      "Arguments": "",
      "NextAction": {
        "Executable": "IG_ToggleToolbar",
        "Arguments": false
      }
    },
    "ToggleOff": {
      "Executable": "MnuFullScreen",
      "NextAction": {
        "Executable": "IG_ToggleToolbar",
        "Arguments": true
      }
    }
  }
},

The Executable can be:

The list of events for MouseClickActions:

public enum MouseClickEvent
{
LeftClick = 1,
LeftDoubleClick = 2,
RightClick = 3,
RightDoubleClick = 4,
XButton1Click = 5,
XButton1DoubleClick = 6,
XButton2Click = 7,
XButton2DoubleClick = 8,
WheelClick = 9,
WheelDoubleClick = 10,
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants