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 EXIT_SUCCESS;
}
#else
int main()
{
std::cout << "vpKeyboard class works only on unix..." << std::endl;
return EXIT_SUCCESS;
}
#endif