Shows how to use xtd::console::key_available and xtd::console::read_key methods.
#include <xtd/threading/thread>
#include <xtd/console>
auto main() -> int {
do {
console::write_line("\nPress a key to display; press the 'x' key to quit.");
while (console::key_available() == false)
thread::sleep(250_ms);
cki = console::read_key(true);
console::write_line("You pressed the '{0}' key.", cki.key());
} while (cki.key() != console_key::x);
}
Specifies the standard keys on a console.
Definition console_key_info.h:24
The xtd::threading namespace provides classes and interfaces that enable multithreaded programming....
Definition abandoned_mutex_exception.h:11
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.h:10