Difference between using event.type and event->type

By using event.type, you refer to an event object directly. On the other hand, by using event->type, you have a pointer, which points to the location of an event object, which is not the same as the location of the pointer itself.

What is the scope of your event object? Can you show some code examples?

In your case, the best idea is the OnEvent() method without the event as an argument. As the method has access to the event object, which is in the class scope, an argument is unnecessary.