Aleh Arol
unread,Oct 7, 2012, 5:16:18 AM10/7/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to python-ogre...@googlegroups.com
Hi,
I faced a problem 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.
I did investigation and found out 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...
I'm not quite strong with py++ yet, so can anyone give me a clue how to
fix this? Is it enough to manually rewrite the code in the comment in
the hand_made_wrappers.py and regen/rebuild then?
ps. yes I know 1.8 wrappers are pending,(i'm using 1.7.2 rev.1150).
--
Best regards,
Aleh Arol