1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
|
includefile(include/header)
COMMENT(manpage, section, releasedate, archive, short name)
manpage(FBB::OneKey)(3bobcat)(_CurYrs_)(libbobcat-dev__CurVers_)
(One keystroke input)
manpagename(FBB::OneKey)(Single keystroke input, not requiring `Return')
manpagesynopsis()
bf(#include <bobcat/onekey>)nl()
Linking option: tt(-lbobcat)
manpagedescription()
bf(OneKey) objects may be used to realize `direct keyboard input': a
pressed key becomes available without the need for pressing tt(Enter). The
characters are obtained from the standard input stream. Direct key entry
remains in effect for as long as the bf(OneKey) object exists. Once the object
is destroyed the standard input stream will return to its default mode of
operation, in which input is `confirmed' by a newline character.
includefile(include/namespace)
manpagesection(INHERITS FROM)
-
manpagesection(ENUMERATION)
The bf(OneKey::Mode) enumeration is used to control echoing of returned
characters. It has two values:
itemization(
it() bf(OFF): returned characters are em(not) echoed to the standard
output stream;
it() bf(ON): returned characters em(are) echoed to the standard output
stream.
)
manpagesection(CONSTRUCTORS)
itemization(
itb(OneKey(OneKey::Mode state = OneKey::OFF))
This constructor initializes the bf(OneKey) input object. By
default, entered characters are not echoed. By constructing the object
with the bf(OneKey::ON) argument, entered characters are echoed to
the standard output stream.
This construct throws an tt(Exception) exception if it not properly
complete. The constructor may fail for the following reasons:
itemization(
it() the standard input stream is not a tty (e.g., when the
standard input stream is redirected to a file);
it() the current state of the standard input stream can't be
determined;
it() the standard input stream's state can't be changed to the
`direct keyboard input' mode.
)
)
Copy and move constructors (and assignment operators) are not available.
manpagesection(MEMBER FUNCTIONS)
itemization(
itb(int get() const)
Returns the next character from the standard input stream, without the
need for pressing tt(Enter).
itb(void setEcho(OneKey::Mode state))
Changes the echo-state of the bf(OneKey) object. The argument may be
either bf(OneKey::ON) or bf(OneKey::OFF).
)
manpagesection(EXAMPLE)
verbinclude(../../onekey/driver/driver.cc)
manpagefiles()
em(bobcat/onekey) - defines the class interface
manpageseealso()
bf(bobcat)(7), bf(tty)(3bobcat)
manpagebugs()
None Reported.
includefile(include/trailer)
|