function
ListenChar([listenFlag])
Tell the Psychtoolbox function "
GetChar" to start or stop listening for
keyboard input. By default
ListenChar listens when no argument is
supplied. Passing 0 will turn off character listening and reset the
buffer which holds the captured characters. Passing a value of 1 or not
passing any value will enable listening. Passing a value of 2 will enable
listening, additionally any output of keypresses to Matlab windows is
suppressed. Use this with care, if your script aborts with an error,
Matlab may be left with a dead keyboard until the user presses CTRL+C to
reenable keyboard input.
This function isn't entirely necessary to turn on listening as calling
GetChar,
CharAvail, or
FlushEvents will trigger listening on. However,
it is the only method by which to disable listening.
The function does nothing when executed under matlab in -nojvm mode or on
other runtime environments, e.g., GNU/Octave.
For further explanation see help for "
GetChar".
See also:
GetChar
Psychtoolbox/PsychBasic/ListenChar.m