GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  ONEKEY (3)

NAME

FBB::OneKey - Single keystroke input, not requiring ‘Return\(cq

CONTENTS

SYNOPSIS

#include <bobcat/onekey>
Linking option: -lbobcat

DESCRIPTION

OneKey objects may be used to realize ‘direct keyboard input\(cq: a pressed key becomes available without the need for pressing Enter. The characters are obtained from the standard input stream. Direct key entry remains in effect for as long as the 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\(cq by a newline character.

NAMESPACE

FBB
All constructors, members, operators and manipulators, mentioned in this man-page, are defined in the namespace FBB.

INHERITS FROM

-

ENUMERATION

The OneKey::Mode enumeration is used to control echoing of returned characters. It has two values:
o OFF: returned characters are not echoed to the standard output stream;
o ON: returned characters are echoed to the standard output stream.

CONSTRUCTORS

o OneKey(OneKey::Mode state = OneKey::OFF):
This constructor initializes the OneKey input object. By default, entered characters are not echoed. By constructing the object with the OneKey::ON argument, entered characters are echoed to the standard output stream.
This construct throws an Exception exception if it not properly complete. The constructor may fail for the following reasons:
o the standard input stream is not a tty (e.g., when the standard input stream is redirected to a file);
o the current state of the standard input stream can\(cqt be determined;
o the standard input stream\(cqs state can\(cqt be changed to the ‘direct keyboard input\(cq mode. The copy constructor (and the overloaded assignement operator) are not available.

MEMBER FUNCTIONS

o int get() const:
Returns the next character from the standard input stream, without the need for pressing Enter.
o void setEcho(OneKey::Mode state):
Changes the echo-state of the OneKey object. The argument may be either OneKey::ON or OneKey::OFF.
o void verify() const:
Obsoleted, will be removed in a future Bobcat release.

EXAMPLE

/*
                              driver.cc
*/

#include <iostream> #include <string> #include <bobcat/onekey>

using namespace std; using namespace FBB;

int main() { try { OneKey onekey;

cout << \(dqUsage: 1: next chars are echoed, 0: no echo, q: quits\n\(dq;

while (true) { char c; cout << \(dqready...\n\(dq; cout << \(dqGot character \(cq\(dq << (c = onekey.get()) << \(dq\(cq\n\(dq;

switch (c) { case \(cq1\(cq: onekey.setEcho(OneKey::ON); break;

case \(cq0\(cq: onekey.setEcho(OneKey::OFF); break;

case \(cqq\(cq: return 0; } } } catch (Errno const &e) { cout << e.why() << endl; return e.which(); } }

FILES

bobcat/onekey - defines the class interface

SEE ALSO

bobcat(7), tty(3bobcat)

BUGS

None Reported.

DISTRIBUTION FILES

o bobcat_3.25.01-x.dsc: detached signature;
o bobcat_3.25.01-x.tar.gz: source archive;
o bobcat_3.25.01-x_i386.changes: change log;
o libbobcat1_3.25.01-x_*.deb: debian package holding the libraries;
o libbobcat1-dev_3.25.01-x_*.deb: debian package holding the libraries, headers and manual pages;
o http://sourceforge.net/projects/bobcat: public archive location;

BOBCAT

Bobcat is an acronym of ‘Brokken\(cqs Own Base Classes And Templates\(cq.

COPYRIGHT

This is free software, distributed under the terms of the GNU General Public License (GPL).

AUTHOR

Frank B. Brokken (f.b.brokken@rug.nl).

Search for    or go to Top of page |  Section 3 |  Main Index


libbobcat-dev_3&.25&.01-x&.tar&.gz FBB::ONEKEY (3bobcat) 2005-2015

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.