How to echo keystrokes for user input

    This will not be a problem in Windows 95/NT, but if you want to write portable code, or you are writing console programs for Linux, the terminal settings being used for improv environments do not echo keyboard characters to the sceen.

    To allow keyboard characters to be displayed on the screen for user input in synthImprov, or batonImprov, you must adust the keyboard settings before user input. For example, here is some code that asks the user to enter a number:

         cout << "Enter a number: ";
         cin  >> number;
      

    In linux, the program user would not be able to see their input unless you do the following:

         cout << "Enter a number: ";
         echoKeysOn();
         cin  >> number;
         echoKeysOff();
      

    In Windows 95/NT, the echoKeys calls are not necessary since the terminal settings are handled differently.











craig@ccrma.stanford.edu