TheRealDannyyy's Recent Forum Activity

  • TheRealDannyyy

    No worries, you actually helped me fix the issue, what's left is a minor thing, the main problem is gone! Thanks!

    No probs we're all on the same messy but useful, web-based boat.

    May I plug you our Official C2 Discord Server,

    with a fairly large amount of active users and quick help with any kind of C2 related problems.

  • The code is just like the one i found, works fine for "body". So i can assign form ID to whole button family? Because i can't find the form proprieties of the button family in the editor

    Yep not like I though it would be, damn C2 family system thought it would make this a little easier.

    Anyway for now I have nothing else to offer, I might come back later so either wait or let the annoying, repetitive work begin.

    To be honest, it's kinda weird that NWjs is showing that thing on your end.

    When I middle click (not inside forms) there is nothing appearing, might want to disable "unbounded scrolling" in the layout properties.

    Unless you plan to create some sort of website using C2, then you should leave it on.

  • Now, the only issue is not really a big deal, i just need to know if there is a "global" form/ID for button objects as well (like "body" for other objects", so i dont need to assign a formID to all the 100+ buttons in my projects

    Armaldio gave me this code, try this one out please:

    "$(function(){$(document.body).mousedown(function(e){if(e.button==1)return false});});"[/code:2ubgxa1g]
    [b][u]
    EDIT:[/u][/b] In the worst case you could create families for the form elements and assign them an ID.
  • The new code works fine for MMB, i just need to assign a form ID to buttons as well (unless there is another "body" for them too)

    Could you precisely explain your problem based on "what you want to achieve" and "what the problems are", sorry but I'm a little confused right now.

  • This one works as intended, it disables the scroll icon, but retains the ability to interact with MMB

    document.body.onmousedown = function(e) { if (e.button === 1) return false; }

    He's on it, might take a little while seems to be busy at the moment.

    By the way, what about the previous one with the rightclick context menu, do right click actions work as intended?

  • ...

    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

    I'm not an expert but doing that in JS sounds like a pain in the a**, I can give to over to Armaldio again but I promise you nothing.

  • 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.

    EDIT: You only use NWjs for this right, like I've already stated the results of these scripts may vary on other browsers?

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

    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:5jm700ve]
  • 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:

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

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

  • Did someone who currently has to deal with these issues, test out if it's still occurring in the recent versions of C2 (r239) and NWjs (v0.18.1)?

  • 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.

    Yeah you would have to use an auto-screenshot program with a delay to screenshot that, whoops .

    Anyway, thanks to the JS magician Armaldio I've got this for you:

    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. Set an ID for the form element(s) where you want to prevent middle clicking

    5. Replace the ID inside the script with the ID you want to use (I've already set "test" as the ID in the script below, just replace the word after the "#" to whatever you like.)

    6. Middle clicking is now no longer an option, you rule over the middle click function now!

    "$(function(){$('#test').mousedown(function(e){if(e.button==1)return false});});"[/code:2ds8i2fa]
    
    [i]By the way, I think that it should be possible to implement features like this into the plugins themselves.
    If someone thinks about doing a "form +" plugin with additional features, feel free to add the stuff from above.[/i]
  • 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?

    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.

TheRealDannyyy's avatar

TheRealDannyyy

Member since 30 Sep, 2014

Twitter
TheRealDannyyy has 18 followers

Trophy Case

  • 10-Year Club
  • Jupiter Mission Supports Gordon's mission to Jupiter
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • Forum Hero Made 1,000 posts in the forums
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • Great Comment One of your comments gets 3 upvotes
  • Email Verified

Progress

18/44
How to earn trophies

Blogs