FG Spreadshirt Swag
  1. #1

    Capturing mouse double-click.

    I was wanting to write some code that would minimize windows when you double-click the window bar on top of windows, similar to how it works on Roll20. Having to right-click and go through a menu each time is slow in comparison, particularly when you have multiple windows open that you want to keep around.

    So I was wondering if it is possible to detect double mouse clicks with scripts? Similar to how you detect a single mouse click, and if any buttons are held down for example.
    Extension writer, FGU Backer, Ultimate License holder.

    5E Enhancer (development and support on hold for now)

    Combat Enhancer 5E Classic (no longer officially supported, community support only)

    ps. Do not send PM's for support for the extensions I write, I will not not be able to respond there. Use the relevant forum threads instead so the community can benefit from the replies, thank you.



  2. #2
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,362
    If it's a windowcontrol: https://www.fantasygrounds.com/refdo...#onDoubleClick

    I don't think the whole of the top bar of a window is a windowcontrol, but at least the title will be.

    The problem is - I'm not sure that you can minimise a window through the FG API. You can close a window, but I can't find an API function to minimise a window.
    Private Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!

  3. #3
    Thanks Trenloe, I don't know how I missed it.

    1) The idea was to get the mouse position from the top left corner of the window controller. Maybe using the window controllers getPosition() function, though it might only return pixel positions within its contents, not including the top bar. I'd need to test it out.
    2) Measure out the size of the menu bar in photoshop in pixles.
    3) Then minimize if the click took place within the window bar area.

    Going to have to do a search through the CoreRPG code to see if I can find any minimizing code I can hook into when I next get the time.
    Last edited by StoryWeaver; October 25th, 2019 at 03:34.
    Extension writer, FGU Backer, Ultimate License holder.

    5E Enhancer (development and support on hold for now)

    Combat Enhancer 5E Classic (no longer officially supported, community support only)

    ps. Do not send PM's for support for the extensions I write, I will not not be able to respond there. Use the relevant forum threads instead so the community can benefit from the replies, thank you.



  4. #4
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,362
    Quote Originally Posted by Styrmir View Post
    Going to have to do a search through the CoreRPG code to see if I can find any minimizing code I can hook into when I next get the time.
    I've already searched through all of my unzipped rulesets for minimize but I might have missed something. Give it a go. Good luck! :-)
    Private Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!

  5. #5
    LordEntrails's Avatar
    Join Date
    May 2015
    Location
    -7 UTC
    Posts
    17,150
    Blog Entries
    9
    There should be something right? Since you can minimize a window bias right click radial menu currently. Maybe it just has a name other than expected?

    Problems? See; How to Report Issues, Bugs & Problems
    On Licensing & Distributing Community Content
    Community Contributions: Gemstones, 5E Quick Ref Decal, Adventure Module Creation, Dungeon Trinkets, Balance Disturbed, Dungeon Room Descriptions
    Note, I am not a SmiteWorks employee or representative, I'm just a user like you.

  6. #6
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,362
    Quote Originally Posted by LordEntrails View Post
    There should be something right? Since you can minimize a window bias right click radial menu currently.
    You'd think so. But that right-click menu to minimize is built into the FG application, that menu is not available in the API. And neither, it seems, is API code to minimize a window. All API code has to be decided to be made public, so maybe there's a reason minimize isn't, or maybe it's just not there, or maybe it's hidden (and not documented).
    Private Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!

  7. #7
    Nope, I checked late yesterday. There's no API to minimize. It would have to be something that is added down the road.

    JPG

  8. #8

    Join Date
    Apr 2008
    Location
    Virginia Beach
    Posts
    3,096
    There is a shortcut to evoke a radial menu from its position but away from computer. But it does no coding good because I don’t believe you can inject key commands in code.

  9. #9
    LordEntrails's Avatar
    Join Date
    May 2015
    Location
    -7 UTC
    Posts
    17,150
    Blog Entries
    9
    Sounds like someone should add it to the wishlist so Moon doesn't forget about this
    Oh, well, even though it's not my idea, here you go!
    https://fg2app.idea.informer.com/proj/fg2app?ia=129345

    Problems? See; How to Report Issues, Bugs & Problems
    On Licensing & Distributing Community Content
    Community Contributions: Gemstones, 5E Quick Ref Decal, Adventure Module Creation, Dungeon Trinkets, Balance Disturbed, Dungeon Room Descriptions
    Note, I am not a SmiteWorks employee or representative, I'm just a user like you.

  10. #10
    That's on hold then until we get the API for it in that case.

    Thanks for that everyone, I added my vote to the wishlist for the API, unless you guys decide to bake it in to FGU at its core instead.
    Extension writer, FGU Backer, Ultimate License holder.

    5E Enhancer (development and support on hold for now)

    Combat Enhancer 5E Classic (no longer officially supported, community support only)

    ps. Do not send PM's for support for the extensions I write, I will not not be able to respond there. Use the relevant forum threads instead so the community can benefit from the replies, thank you.



Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
DICE PACKS BUNDLE

Log in

Log in