Defold-input/ consuming input/ pause button

i’m using the defold-input cursor script to drag my gameobjects around.
but i don’t want the messages, when i show a gui screen to make the player pick an option.
so is there a way to temporarily disable the cursor script?

a bit like the input consuming from the example at https://defold.com/manuals/input/

i tried consuming input … but apparently i still get a released message from the cursor script, after i click my gui button.

i tried finding an example with a pause button like that, but wasn’t lucky

If the GUI has acquired input after your game it should get input first and you should be able to consume it by returning true in on_input of your gui_script.

Could you maybe release input focus on your game when you show a GUI and then acquire it again when the GUI is removed?

sounds reasonable, will try to do that.

is there some easy way to list the whole input stack, to see whats going on ?
if not i’ll make a drawing. good old pen&paper :smiley:

No, sorry, we don’t have any functionality like that. We have discussed a way to include it, maybe in the profiler data.

You can probably wrap your acquire_input_focus calls into a helper module, that keeps track of the stack for you?

1 Like

i found the problem:
in my gui i did everything to on a pressed event. then i consumed, and “gave controll” back to my main game… and then it picked up the released event…

so now in gui i react not on pressed, but released, so then the maingame gets no released.
works as designed :smiley: