added timer and key events