A problem exists when subscribing (only) for event means that I handled
it in anyway. In other words it doesn't matter what I return from
onKeyDown(for example) True (handled) or False(not handled) CEGUI always
think I handled the event.
Error case is when I want to override some keys in MultilineEditBox,
while I'd like other to keep working as expected they don't work just
because I subscribed for KeyDown.
Investigation showed that:
1) no matter what I return from python handler True/False/None - CEGUI
always get true (I debugged down to the wrapper code)
2) I'm not very strong in py++, but I found (in
code_generators/cegui/hand_made_wrappers.py line 126) the following:
class EventCallback
{
public:
....
bool operator() (const CEGUI::EventArgs &args) const
{
....
else if (dynamic_cast<CEGUI::KeyEventArgs *>((CEGUI::EventArgs
*)&args))
if (mMethod.length() > 0 )
boost::python::call_method<void>(mSubscriber,
mMethod.c_str(),
static_cast<const
CEGUI::KeyEventArgs&>(args) );
else
boost::python::call<void>(mSubscriber,
static_cast<const
CEGUI::KeyEventArgs&>(args) );
....
return true;
}
which rendered to EventSet.pypp.cpp:78 in the generated code.
As you can see it doesn't respect callback's return value because always
returning true and even using boost::python::call with R parametrized
with void...
Reproduced using 1.7.1 rev.1150.
CEGUI 0.7.5
Attached patch (rough, CEGUI native binding is trunk fixed that nicer, but there's a bit different file layout thus no chance to reuse). -p 4
patch - use with -p 4