added keyboard and mouse events
update gui events handler