MyWebUniversity.com Home Page
 



Darwin Mac OS X man pages main menu
cursgetwch(3X)                                              cursgetwch(3X)



NAME
       getwch,  wgetwch,  mvgetwch,  mvwgetwch,  ungetwch  - get (or push
       back) a wide character from curses terminal keyboard

SYNOPSIS
       ##include <>

       int getwch(wintt **wch);;
       int wgetwch(WINDOW **win,, wintt **wch);;
       int mvgetwch(int y,, int x,, wintt **wch);;
       int mvwgetwch(WINDOW **win,, int y,, int x,, wintt **wch);;
       int ungetwch(const wchart wch);;

DESCRIPTION
       The getwch, wgetwch, mvgetwch, and mvwgetwch functions read a char-
       acter  from  the terminal associated with the current or specified win-
       dow.  In no-delay mode, if no  input  is  waiting,  the  value  ER  is
       returned.   In  delay  mode,  the program waits until the system passes
       text through to the program.  Depending on the setting of cbreak,  this
       is  after  one  character  (cbreak  mode),  or  after the first newline
       (nocbreak mode).  In half-delay mode, the program waits until the  user
       types a character or the specified timeout interval has elapsed.

       Unless  noecho has been set, these routines echo the character into the
       designated window.

       If the window is not a pad and has been moved  or  modified  since  the
       last call to wrefresh, wrefresh will be called before another character
       is read.

       If keypad is enabled, these functions respond  to  the  pressing  of  a
       function key by setting the object pointed to by wch to the correspond-
       ing KEY value defined in <> and returning KEYCODEYES.  If  a
       character  (such  as  escape) that could be the beginning of a function
       key is received, curses sets a timer.  If the remainder of the sequence
       does arrive within the designated time, curses passes through the char-
       acter; otherwise, curses returns the function key value.  For this rea-
       son,  many terminals experience a delay between the time a user presses
       the escape key and the time the escape is returned to the program.

       The ungetwch function pushes the wide character wch back onto the head
       of  the input queue, so the wide character is returned by the next call
       to getwch.  The pushback of one character is guaranteed.  If the  pro-
       gram  calls  ungetwch  too  many  times without an intervening call to
       getwch, the operation may fail.

NOTES
       The header file  <>  automatically  includes  the  header  file
       <>.

       Applications  should  not  define the escape key by itself as a single-
       character function.

       When using getwch, wgetwch, mvgetwch,  or  mvwgetwch,  applications
       should not use nocbreak mode and echo mode at the same time.  Depending
       on the state of the tty driver when each character is typed,  the  pro-
       gram may produce undesirable results.

       All functions except wgetwch and ungetwch may be macros.

RETURN VALUES
       When  getwch,  wgetwch,  mvgetwch, and mvwgetwch functions success-
       fully report the pressing of a function key, they return  KEYCODEYES.
       When they successfully report a wide character, they return OK.  Other-
       wise, they return ER.

       Upon successful completion, ungetwch returns OK.  Otherwise, the func-
       tion returns ER.

SEE ALSO
       curses(3X),    cursgetch(3X),    cursinswch(3X),    cursinopts(3X),
       cursmove(3X), cursrefresh(3X)



                                                              cursgetwch(3X)
Darwin Mac OS X man pages main menu

Contact us      |       About us      |       Term of use      |       Copyright © 2000-2010 MyWebUniversity.com ™