#include <visp3/core/vpConfig.h>
#include <visp3/gui/vpDisplayFactory.h>
#ifdef ENABLE_VISP_NAMESPACE
#endif
int main()
{
#if defined(VISP_HAVE_DISPLAY)
#if (VISP_CXX_STANDARD >= VISP_CXX_STANDARD_11)
#else
#endif
std::cout << "Waiting a keyboard event..." << std::endl;
std::cout << "A keyboard event was detected" << std::endl;
int cpt_event = 0;
char key[10];
std::cout << "Enter a non blocking keyboard event detection loop..." << std::endl;
do {
if (event) {
std::cout << "Key detected: " << key << std::endl;
cpt_event++;
}
} while (cpt_event < 5);
#if (VISP_CXX_STANDARD < VISP_CXX_STANDARD_11)
delete d;
#endif
#else
std::cout << "No gui available to display an image..." << std::endl;
#endif
return EXIT_SUCCESS;
}
Class that defines generic functionalities for display.
static bool getKeyboardEvent(const vpImage< unsigned char > &I, bool blocking=true)
static void display(const vpImage< unsigned char > &I)
static void flush(const vpImage< unsigned char > &I)
Definition of the vpImage class member functions.
std::shared_ptr< vpDisplay > createDisplay()
Return a smart pointer vpDisplay specialization if a GUI library is available or nullptr otherwise.
vpDisplay * allocateDisplay()
Return a newly allocated vpDisplay specialization if a GUI library is available or nullptr otherwise.
VISP_EXPORT int wait(double t0, double t)