create some constants to get rid of magic numbers
update type id for keyboard event handling
add support for mouse events