#include "../include/terminal.h" #include #include #include #include #include #define DEFAULT_CONSOLE_MODE (\ ENABLE_ECHO_INPUT |\ ENABLE_LINE_INPUT |\ ENABLE_MOUSE_INPUT |\ ENABLE_PROCESSED_INPUT |\ ENABLE_QUICK_EDIT_MODE |\ ENABLE_WINDOW_INPUT |\ ENABLE_PROCESSED_OUTPUT |\ ENABLE_WRAP_AT_EOL_OUTPUT |\ ENABLE_VIRTUAL_TERMINAL_PROCESSING |\ DISABLE_NEWLINE_AUTO_RETURN |\ ENABLE_LVB_GRID_WORLDWIDE) #define RAW_CONSOLE_MODE \ ENABLE_WINDOW_INPUT |\ ENABLE_VIRTUAL_TERMINAL_INPUT // ENABLE_PROCESSED_INPUT |\ static DWORD mode = 0; void enter_raw_mode() { GetConsoleMode( GetStdHandle(STD_INPUT_HANDLE), &mode ); SetConsoleMode( GetStdHandle(STD_INPUT_HANDLE), RAW_CONSOLE_MODE ); } void exit_raw_mode() { SetConsoleMode( GetStdHandle(STD_INPUT_HANDLE), mode ); }