This function is retained only for compatibility. New code should not use it. KbdGetConsole is the preferred function for new code.

The contents and ending condition depend on the keyboard state: