Thread safe queue for handling keyboard events