Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Button callback executes three times #1

Closed
abigpotostew opened this issue Mar 4, 2018 · 1 comment
Closed

Button callback executes three times #1

abigpotostew opened this issue Mar 4, 2018 · 1 comment

Comments

@abigpotostew
Copy link

abigpotostew commented Mar 4, 2018

The callback to button.register gets executed three times per click release. I'm not sure if there's a phase to the button callback? Such as click, hold, release. But it's not clear to me why this happens.
Reproduction:
In any of your examples with a button, add a static print statement-- such as in savefile.gui_script inside add a print statement after line #9:

button.register("load/button", function() --line #9
    print("load") --added print
@britzl
Copy link
Owner

britzl commented Mar 4, 2018

The examples you've tested from Ludobits did use the wrong inout bindings file. It used the all.input_bindings file with multiple bindings for left mouse button, which was the reason for seeing multiple callbacks. I've updated the Ludobits repo. Please give the new version of those examples a try or test the examples in this repo to verify that button callbacks work as intended. Re-ropen if you still have problems with buttons.

@britzl britzl closed this as completed Mar 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants