Make common MousePressManager and KeyPressManager

Made MousePressManager and KeyPressManager classes
to eliminate some code duplication and to make
extension easier later.