Danwood's Recent Forum Activity

  • > Yes it's something about scrolling! But the new code still doesn't work (does "body" represents all the objects?).

    >

    It should include everything exept form elements and how you block it for form elements is already mentioned above.

    Now i see it why it didn't work! I was accidentally clicking on a button

    Is there also another universal form for button objects like "body"? It would save me a lot of time instead of assigning a form id to 100 buttons

    Btw thank you so much!

    EDIT: nevermind, apparently, the code disabled every use of middle mouse, i would need a way to only prevent the scroll thing to appear, not disabling MMB as a whole

  • So you kinda have scrollable game I guess, well try the code from below just execute it in the way you already know.

    "$(function(){$('body').mousedown(function(e){if(e.button==1)return false});});"[/code:15fz32i3]
    

    Yes it's something about scrolling! But the new code still doesn't work (does "body" represents all the objects?).

  • In the object propeties of the form object that you want to use.

    That's only for the button objects, the problem occurs when middle clicking on everything, even on the background

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Glad to see there is a way to prevent it! However, I'm stuck here:

    4. Set an ID for the form element(s) where you want to prevent middle clicking

    I didn't even know there is a way to assign an ID to whole categories of objects, how can i do it?

  • Could you provide more details please, maybe screenshots?

    Also please note that I only tested this using NWjs, the result of this script may vary using other browsers.

    EDIT: Never mind I know what you mean now, I thought there were problems with the script.

    To be honest I have no clue how to prevent that icon from appearing, there might be a way to block the button itself.

    I'll ask this question to some experienced JS devs, they might find an easy solution for you soon.

    Thank you! I tried to take a screenshot but as i press any button the icon disappears. It's problematic not for the icon itself, but the fact it makes it difficult to properly use the middle mouse button.

  • I know that this bug report is closed, however for people that stumble upon this post for a fix here you go:

    1. Add the "browser" plugin to your project

    2. Add an event "on start of layout" (you might have to use it on a globally included eventsheet)

    3. Add the browser action "execute Javascript" and use the code from below

    4. All right click actions should be blocked from now on

    Code:

    "document.addEventListener('contextmenu', function(e){e.preventDefault();}, false);"[/code:2jz76is9]
    

    There is a similiar thing happening when middle-mouse clicking: it appears a scrolling icon and the some key actions are prevented unless i remove it. Is there a way to disable it too?

  • I know that this bug report is closed, however for people that stumble upon this post for a fix here you go:

    1. Add the "browser" plugin to your project

    2. Add an event "on start of layout" (you might have to use it on a globally included eventsheet)

    3. Add the browser action "execute Javascript" and use the code from below

    4. All right click actions should be blocked from now on

    Code:

    "document.addEventListener('contextmenu', function(e){e.preventDefault();}, false);"[/code:3cyxe9vu]
    

    Thank you so much!! It won't happen anymore

  • Danwood I see that occuring as well on preview in the opera browser, might worth investigating

    I wonder if there's a way to fix it myself, or if we need to wait for a future NW update <img src="{SMILIES_PATH}/icon_rolleyes.gif" alt=":roll:" title="Rolling Eyes">

    UPDATE: seems like nightly build today fixed it! (and that's why i always update <img src="{SMILIES_PATH}/icon_razz.gif" alt=":P" title="Razz">)

    https://dl.nwjs.io/live-build/10-20-201 ... 6/v0.18.1/

  • I've also noticed there is a chrome menu appearing when right clicking on a button!

  • Just a quick update, it turns out NW.js 0.18 had a bug which broke Construct 2 games. It's already been fixed though and apparently there will be an 0.18.1 release tomorrow. Assuming that works, we'll have a NW.js update out then.

    That would also explain why you couldn't get 0.18 to work!

    Thank you Ashley! That's a relief

  • It strongly depends on the game you're making: our game took over 2 years, being a survival game on top of a complex ecosystem simulator. With C2 you can make large games as well, if you know how to organize your workflow and optimize, and definitely if you know how to use the C2 event system.

  • We should have an official installer out shortly for NW.js 0.18. I think updating from the direct download is easy to make a small mistake and break it!

    Great!

Danwood's avatar

Danwood

Member since 2 Jan, 2014

None one is following Danwood yet!

Trophy Case

  • 10-Year Club
  • Forum Contributor Made 100 posts in the forums
  • Regular Visitor Visited Construct.net 7 days in a row
  • Steady Visitor Visited Construct.net 30 days in a row
  • RTFM Read the fabulous manual
  • x5
    Great Comment One of your comments gets 3 upvotes
  • Email Verified

Progress

16/44
How to earn trophies