Skip to content

Commit

Permalink
native::console::echo method Implementation on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
gammasoft71 committed Oct 6, 2023
1 parent fbe0589 commit 640b16e
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/xtd.core.native.win32/src/xtd/native/win32/console.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@ namespace {
SetConsoleCtrlHandler(&__handler_routine, TRUE);
return false;
}();
bool echo_off = []()-> bool {
DWORD mode = 0;
GetConsoleMode(GetStdHandle(STD_INPUT_HANDLE), &mode);
return SetConsoleMode(GetStdHandle(STD_INPUT_HANDLE), mode & ~ENABLE_ECHO_INPUT) == TRUE;
}();

bool treat_control_c_as_input = false;
auto background_color = CONSOLE_COLOR_DEFAULT;
auto foreground_color = CONSOLE_COLOR_DEFAULT;
Expand Down Expand Up @@ -208,14 +214,11 @@ bool console::cursor_visible(bool visible) {
}

bool console::echo(bool on) {
/*
DWORD mode = 0;
GetConsoleMode(GetStdHandle(STD_INPUT_HANDLE), &mode);
if (on) mode |= ENABLE_ECHO_INPUT;
else mode &= ~ENABLE_ECHO_INPUT;
return SetConsoleMode(GetStdHandle(STD_INPUT_HANDLE), mode) == TRUE;
*/
return true;
}

int_least32_t console::foreground_color() {
Expand Down

0 comments on commit 640b16e

Please sign in to comment.