IGNORE mouse clicks for X seconds ?

0 favourites
From the Asset Store
Total customisation of the input! You can combine inputs from all peripherals. Make your game accessible for everyone!
  • Hi All,

    How do I make the mouse to IGNORE any clicks?

    Not by clicking on specific object or area but on ANYTHING, just ignore the Mouse Clicking no matter where it clicks for X seconds.

    Thanks ahead!

    Tagged:

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Alon

    There can be multiple ways, here is a simple one.

    Wherever you want the mouse to be able to Click, add another Check Boolean condition in AND with Mouse Click condition

    Now this Boolean can be True once your X seconds are over. Whichever action is performing those X seconds, at the end add a line to Toggle that Boolean to True so click starts to work else keep the Toggle to False and click won't work.

  • Thanks for the quick reply umarfarooq :)

    I guess that there is still no simple built-in action for this consider it's C3 and it should make life easier like Activate/Deactivate groups for example, bummer...

    .

    Anyways,

    The thing I don't understand how to do is, even if I use a Boolean to check... what ACTION will make sure that Mouse Click in general won't affect anything for X seconds.

    Since I don't want to check the mouse over a specific area or object, but CLICK in any place over the layout in general.

    For example, I created this Global Variable Boolean: "Mouse_Can_Click" init True

    If Mouse_Can_Click = ??? (no action for IGNORE mouse input)

    The only Mouse Actions I have are "Set cursor from sprite" and "Set Cursor style" but Nothing about ignoring the mouse input... I probably missing something, can you please help?

    Thanks ahead! :)

  • Alon

    Good progress. You're half way there.

    Just add another condition in "AND" to either of these and you'll get the idea how to implement it for X seconds. You can refine it then.

    Still having problem, drop me an email, I'll send my Skype ID, share screen, I'll do it for you.

    Thanks,

  • Thanks for the kind help, I appreciate it! :)

    I guess what I'm trying to do is much more complicated than related to specific action, that's why I was sad to find out that there is no built-in "Ignore Mouse Input" in C3... such a basic event lots of users could use to switch on/off for general use instead of limit it to specific action.

    .

    My issue is more complicated because it's based on a BUG in the NW.js that I the only way to solve it is to put a delay (after I tested it).

    The problem is when you open a NW.js Dialog Window and CANCEL it and click more than once on the CANCEL button... it will OPEN the dialog again.

    I have this issue on any open dialog (save file, export image, import) the only way to avoid it is to put at least "wait 0.25 seconds" after click the NW.js cancel button...

    Since my project is much more complex I can't just use the wait 0.25 on every function since it activate and deactivate other groups (hard to explain the all thing but it's complex).

    .

    That's why I need a simple IGNORE the mouse click (IN GENERAL) and not for a specific condition, so it will also ignore many clicks on the CANCEL or OK NW.js window buttons.

    Sorry for the long explanation, I'm just trying everything I can to solve this but there is no such simple event in C3 such as: "IGNOR MOUSE INPUT" which makes me go crazy because it could be so much simple to do in such complicated project instead of go around it to try find a simple solution.

  • Alon

    Yup. It would be help to have such a simple toggle for mouse.

    Let me know if you need assistance with your project though. It sounds more tricky to explain then it actually is to implement. Doesn't matter how many times you've to repeat it throughout your application.

  • Thanks again umarfarooq, you're very kind! yes I hope that one day we'll have Keyboard + Mouse Input built-in switches in general, it's much easier and efficient for sure! :)

    I just reported this nw.js bug on their github, I hope they will find a solution for it.

    .

    OFF TOPIC:

    Speaking of nw.js - Ashley sorry to bother you but I wonder, if they'll fix the bug sooner or later, will C3 automatically always have the latest nw.js version? or on next stable update?

    I'm asking because I'm not sure how it works since it's C3 + built-in nw.js, can you please explain?

    Thanks ahead!

  • I told you my very easy solution in another post - put a big transparent Text Box object above everything on the screen. It will automatically block all mouse input, you don't need to change any events.

  • I told you my very easy solution in another post - put a big transparent Text Box object above everything on the screen. It will automatically block all mouse input, you don't need to change any events.

    I remember trying that, I put a huge Text Input object on the size of the layout, made it invisible... but I can still click and also the bug I described is still happen so I guess it's not working for me or I just don't know how to make it work.

  • the dialog box would be floating above the everything else - and not listening to events from construct anyway, so disabling mouse events in Construct probably wont help.

    if it is a bug in NW.js, they will have to fix it. Most people know not to double click a button.

  • I put a huge Text Input object on the size of the layout, made it invisible

    No, invisible TextBox doesn't work. It needs to be visible with transparent background (you can do this with CSS). I used this method in another app and it works great.

  • About that bug of yours - it must be in your code. I tested with NWJS Open Dialog, no matter how fast and how many times I click Cancel button, it doesn't open the dialog again.

  • > I put a huge Text Input object on the size of the layout, made it invisible

    No, invisible TextBox doesn't work. It needs to be visible with transparent background (you can do this with CSS). I used this method in another app and it works great.

    The thing is that I tried it with and without visible, it's not working because it is a NW.JS bug.

    Also.. it's a very unnatural work-around way to do something so simple such as "IGNORE Mouse Input" in general which should be a built-in since... ever?

    I mean I know it's a solution, but in my case it doesn't work after testing it as you suggested and I appreciate it because I do need a solution for this annoying thing.

    .

    Unfortunately, I'll have to wait for nw.js to fix it and hopefully that it will also be updated in C3 updates.

    because I don't think such awesome useful feature "IGNORE Mouse / Keyboard" to come to C3 anytime soon (I wish!)

  • Not sure if you've seen my previous comment. I don't think there is a bug in NWJS, and the bug report you logged will probably get closed because you didn't provide a sample project file. It looks like the bug is in your events.

    .

    Oh, I just realized, you logged this bug on NWJS github, not on Scirra's.

  • Not sure if you've seen my previous comment. I don't think there is a bug in NWJS, and the bug report you logged will probably get closed because you didn't provide a sample project file. It looks like the bug is in your events.

    Sorry for the delay, just saw that!

    If that's a bug on my code, that's actually good news for me! :)

    .

    The thing is that I have no clue what could it be, take for example one of the NW.js window dialog and maybe you'll notice something I didn't?

    Basically I couldn't do that code without your help dop2000 sensei so even if it's there I probably can't see where is the issue in these lines. (import / load / save have almost the same code.. not exactly) but the bug is the same for anything that is related to the Window Dialog.

    BTW - Even if I disable many lines such as the functions and the other Boolean variables, the bug is there.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)