Keyboard example.
#include <visp3/core/vpConfig.h>
#include <visp3/core/vpDebug.h>
#if !defined(_WIN32) && (defined(__unix__) || defined(__unix) || (defined(__APPLE__) && defined(__MACH__)))
#include <iostream>
#include <signal.h>
#include <stdio.h>
#include <visp3/io/vpKeyboard.h>
int main()
{
std::cout << "Push some characters on the keyboard..." << std::endl;
printf("Hit 'q' or 'Q' to stop the loop ...\n");
std::cout << "Start the keyboard scrutation..." << std::endl;
for (;;) {
printf("You hit key: %d '%c'\n", c, c);
if (c == 'q' || c == 'Q') {
printf("You hit key: %d %c we stop the loop\n", c, c);
break;
}
}
}
std::cout << "Enter an integer: ";
int myvalue;
std::cin >> myvalue;
return 0;
}
#else
int main()
{
vpTRACE(
"Sorry, for the moment, vpKeyboard class works only on unix...");
return 0;
}
#endif