Added support for mouse and keyboard input events. Modified examples
to be able to close with Escape key. Post on closing event when exiting
from engine event loop.