#include <string>
#include <iostream>
#include <iomanip>
#include "JSystem/JKeypress.hh"
#include "Jeep/JParser.hh"
#include "Jeep/JMessage.hh"
Go to the source code of this file.
|
int | main (int argc, char *argv[]) |
|
Example program to test key board pressings (class JSYSTEM::JKeypress).
- Author
- mdejong
Definition in file JKeypress.cc.
◆ main()
int main |
( |
int |
argc, |
|
|
char * |
argv[] |
|
) |
| |
Definition at line 16 of file JKeypress.cc.
25 JParser<> zap(
"Example program to test key board pressings.");
32 catch(
const exception &error) {
33 FATAL(error.what() << endl);
41 cout <<
"> " << flush;
43 int c = JKeypress(echo).get();
45 cout << endl <<
"return <" << (char) c <<
">" << endl;
50 JKeypress keypress(
false);
54 for (
int i = 0; i != 10000; ++i) {
56 cout << setw(5) << i << flush <<
'\r';
58 if (keypress.timeout(timeout_us)) {
64 cout << endl <<
"return <" << (char) c <<
">" << endl;