Conversation
|
Hello @Kapusta-dev 👋 • Rather than using timers, you can use a better and stable way, which is (Boolean variable) • Short description should be shorter than what you have currently. • Long description shouldn't have the same short description sentence, unless you want that. Honestly, the extension can be done using a Boolean variable as i showed above, so currently its very basic and simple and unlikely to get merged into GDevelop Reviewed extensions, But it can be added in the community extensions if you still want it in :3 Thanks for submitting the extension 💖 would love to see more extensions from you as well 😉 |
|
Hey @VegeTato The button example provided was just a quick way to demonstrate the ease of use for the extension, and a situation where it would come in handy. With the existing mouse events it will cycle through all the colors at once. With this extension it will cycle through each color per click. As I'm using my extension more though I'm finding a few gotchas here and there (i.e. in certain cases the event must be called/exist on event where the parent is not shared, otherwise it does not run the mouse release timer. It must also be the first condition in the block) so perhaps it's not suited yet to be added officially and definitely needs some more work on it. I'll have to keep poking at it - I think GDevelop would definitely benefit from an easy and straightforward 'mouse on click' event. Thanks again! |
|
Thank you for submitting an extension. Do you know about this other submission? I think it may answer the same kind of issues. |
|
Thanks D8H, that's a great extension and definitely solves the issue for buttons. Per my second example in the comment above the goal for the extension was to also solve general mouse 'on click' detection for instances where you're not interacting with a button directly. I'll edit the description to reflect that, I think I focused too much on the button example. :) |
|
ok, I guess the logic would be very similar to the "Double-click" extension. It could be interesting to see if they used the same logic. I can't think of any UI that does something different for a mouse button release and a pressed + release in a short amount of time. |
ok
No engine is Voldemort here. You can speak freely of Construct, ClickTeam, Godot or anything else 😄 |
|
This PR is looking dead, I'll close it, feel free to reopen if someone's getting back to it |




Description
This extension adds the ability to detect Mouse 'On Click' and Keyboard 'On Press' conditions, so that events will only run when the key/button were just pressed, rather than held down.
Useful so that holding down the mouse button and moving over a button does not trigger the button being activated.
How to use the extension
Put either the 'Detect Mouse On Click Event' or 'Detect Keyboard On Press Event' as conditions for any events that need to be triggered immediately on a mouse press / keyboard button click, and not trigger if mouse or keyboard buttons are being held thereafter.
For example, to make sure a button is only triggered when it is clicked and not when the mouse button is held down and dragged over it, create the following event:
Conditions:
Events:
Checklist
What tier of review do you aim for your extension?
Reviewed
Example file
OnClickDetectorExample.zip
Extension file
OnPressDetector.zip