Oring key event callback result.
Currently, when user add many callbacks to one view's key event, the last
callback result is became key event result.(Even if one of callback returns true)
Now, if one of callback returns true, the result of key event is true
via Oring callback result.
Change-Id: I38c90c06b4232aeb557cb5219e63d64fb9d6e7f5
Signed-off-by: minho.sun <minho.sun@samsung.com>
{
KeyEventArgs e = new KeyEventArgs();
+ bool result = false;
+
e.Key = Tizen.NUI.Key.GetKeyFromPtr(keyEvent);
if (_keyEventHandler != null)
{
- return _keyEventHandler(this, e);
+ Delegate[] delegateList = _keyEventHandler.GetInvocationList();
+
+ // Oring the result of each callback.
+ foreach ( EventHandlerWithReturnType<object, KeyEventArgs, bool> del in delegateList )
+ {
+ result |= del( this, e );
+ }
}
- return false;
- }
+ return result;
+ }
private EventHandler _onRelayoutEventHandler;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]