FBB::OneKey(3bobcat)
π FBB::OneKey π
okay bestie, you're reading the bobcat manual (that's the 3bobcat section of the manual, iykyk) and this page is literally all about FBB::OneKey β¨ put your seatbelt on π¦
β¨ NAME β¨
FBB::OneKey β single keystroke input, not requiring `Returnβ π
like... you press a key and it's just there. no Return, no waiting, no drama. periodt.
πΈ SYNOPSIS πΈ
#include <bobcat/onekey>
Linking option: -lbobcat
π¦ DESCRIPTION π¦
So OneKey objects are how you get direct keyboard input β the second a key is pressed, that character is available, and you did not have to press Enter first. Not once. π
Where do the characters come from? The standard input stream, bestie. That's the vibe.
Direct key entry stays in effect for as long as your OneKey object exists β it's giving main character energy and it holds that energy the whole time it's alive. Once the object is destroyed, the standard input stream goes right back to its default mode of operation, where input is confirmed by a newline character. bye bestie, back to normal π
π NAMESPACE π
FBB
Every single constructor, member, operator and manipulator mentioned on this man-page lives in the FBB namespace. all of them. no strays. π«Ά
π INHERITS FROM π
-
(nothing. it inherits from no one. it's self-made. iconic.) π
π ENUMERATION π
The OneKey::Mode enumeration is what controls echoing of the returned characters. It has two values, and only two:
OFFβ the returned characters are not echoed to the standard output stream;ONβ the returned characters are echoed to the standard output stream.
β CONSTRUCTORS β
OneKey(OneKey::Mode state = OneKey::OFF)β this constructor initializes theOneKeyinput object. By default, entered characters are not echoed (that's theOneKey::OFFdefault doing its thing β¨). If you construct the object with theOneKey::ONargument instead, then entered characters are echoed to the standard output stream.
This construct throws an Exception exception if it not properly complete. Bestie, it can fail, and here's exactly why:
- the standard input stream is not a tty (e.g., when the standard input stream is redirected to a file);
- the current state of the standard input stream can't be determined;
- the standard input stream's state can't be changed to the
direct keyboard inputmode.
π¨ no cap: copy and move constructors (and assignment operators) are not available. don't try it. π
π MEMBER FUNCTIONS π
int get() constβ returns the next character from the standard input stream, without the need for pressing Enter. chef's kiss, honestly.void setEcho(OneKey::Mode state)β changes the echo-state of theOneKeyobject. The argument may be eitherOneKey::ONorOneKey::OFF. switch it up whenever you want π¦
π₯ EXAMPLE π₯
/*
driver.cc
*/
#include <iostream>
#include <string>
#include <bobcat/onekey>
using namespace std;
using namespace FBB;
int main()
{
try
{
OneKey onekey;
cout << "Usage: 1: next chars are echoed, 0: no echo, q: quits\n";
while (true)
{
char c;
cout << "ready...\n";
cout << "Got character β" << (c = onekey.get()) << "β\n";
switch (c)
{
case β1β:
onekey.setEcho(OneKey::ON);
break;
case β0β:
onekey.setEcho(OneKey::OFF);
break;
case βqβ:
return 0;
}
}
}
catch (exception const &e)
{
cout << e.what() << endl;
return 1;
}
}
π FILES π
bobcat/onekey β defines the class interface
π SEE ALSO π
π BUGS π
None Reported.
(not a single one. we love a clean bug list π)
π§ BOBCAT PROJECT FILES π§
https://fbb-git.gitlab.io/bobcat/: gitlab project page;
Debian Bobcat project files:
libbobcat6: debian package containing the shared library, changelog and copyright note;libbobcat-dev: debian package containing the static library, headers, manual pages, and developer info;
πΈ BOBCAT πΈ
Bobcat is an acronym of `Brokkenβs Own Base Classes And Templatesβ. π«Ά
β¨ 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).
okay that's the whole page bestie, you're officially educated π
β¨ this was FBB::OneKey(3bobcat) from libbobcat-dev_6.15.01, dated 2005-2026 β mwah, go forth and read keystrokes with no Return needed ππ¦π
π¦ where this page comes from
- ubuntu stonking: libbobcat-dev 6.15.01-1 Β· GPL-3.0-or-later WITH OpenSSL exception
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms