ataylor Posted March 12, 2015 Share Posted March 12, 2015 I have an interface with many buttons, each with callbacks attached to GUI_CLICKED. These callbacks work as expected when the user clicks them, but it would be better to listen for a different event so that the buttons can be activated using the keyboard. I searched the documentation and found GUI_ACTIVATED (https://developer.unigine.com/en/docs/1.0/scripting/library/gui/class.gui). It sounded like it is supposed to do exactly what I wanted, so I replaced GUI_CLICKED with GUI_ACTIVATED in my world script. But when I try to load world, I get interpreter error unknown token 'GUI_ACTIVATED'. I searched Unigine engine source and found where GUI_* callback variables are added (GuiInterpreter.cpp) but GUI_ACTIVATED is not present. Was it removed intentionally? It is still in documentation. I also experimented with GUI_PRESSED event, but it behaves differently than I need -- the callback is fired every tick as long as the mouse button is held and I need it to fire only once. So what happened to GUI_ACTIVATED? Is there another elegant solution? Link to comment
unclebob Posted March 13, 2015 Share Posted March 13, 2015 Adam, GUI_ACTIVATED callback was removed a long ago but somehow it's still in the docs. Thanks for noticing that, we'll fix that. As for elegant solution, try to use Widget::setCallbackAccel to set a hotkey for a particular callback such as GUI_CHANGED. Link to comment
Recommended Posts