We use Lua bindings to CEGUI in a game, and so far in CEGUI all mouse events emit MouseEventArgs, so we always cast WindowEventArgs to MouseEventArgs with a lua helper
CEGUI.toMouseEventArgs in the mouse event lua function callbacks.
It tripped us up when we subscribed to "Clicked" event of a button and
args.button was containing nonsensical values. After some debugging we found out that we were in actuality receiving a WindowEventArgs and casting it to a MouseEventArgs (through tolua's internal casting mechanism which is used in CEGUI.toMouseEventArgs) resulted in reading a memory not belonging to a WindowEventArgs class!
So my question is, is there a deliberate reason for doing this? Because it is a very unobvious thing. Looking through the documentation for onClicked method I found two more such cases. The name of the event logically falls into the group of mouse events, so it makes sense to send a MouseEventArgs, I believe. Unless there is a specific reason not to, of which I am unfortunately unaware.
I've searched through issues, forums and wiki but didn't find anything useful, and most results were dated earlier than 2010 or marked obsolete.
I guess from now on I'll have to manually review the type of EventArgs that is passed to a callback for each event of each widget type just to be safe.