added KeyboardManager class for better input event management