Shows how to use xtd::console::read_key and xtd::console::key_available methods.
#include <xtd/xtd>
auto main() -> int {
console::write_line("Signal {0} intercepted !", e.special_key());
e.cancel(true);
};
while (true) {
if (console::key_available()) {
auto key_info = console::read_key(true);
console::write_line("Key = {} ({}), Char = '{}' ({}), Modifiers = {}", key_info.key(), as<int>(key_info.key()), key_info.key_char(), as<int>(key_info.key_char()), key_info.modifiers());
if (key_info.key() == console_key::escape) break;
}
}
}
Provides data for the console::cancel_key_press event. This class cannot be inherited.
Definition console_cancel_event_args.hpp:22
#define delegate_
The declaration of a delegate type is similar to a method signature. It has a return value and any nu...
Definition delegate.hpp:900