From: Hugh McMaster Subject: [PATCH 2/2] Add SetInsertMode function Message-Id: Date: Mon, 7 Jul 2014 18:51:28 +1000 This patch adds the SetInsertMode function. It is called when the Insert Mode checkbox in the user32 dialog is toggled. From 694d4cc242f973832d719b169f522719941b980f Mon Sep 17 00:00:00 2001 From: Hugh McMaster Date: Mon, 7 Jul 2014 18:35:01 +1000 Subject: [PATCH 2/2] Add SetInsertMode function --- programs/wineconsole/wineconsole.c | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/programs/wineconsole/wineconsole.c b/programs/wineconsole/wineconsole.c index ab7b1eb..8a578a0 100644 --- a/programs/wineconsole/wineconsole.c +++ b/programs/wineconsole/wineconsole.c @@ -195,6 +195,23 @@ static BOOL WINECON_SetEditionMode(HANDLE hConIn, int edition_mode) } /****************************************************************** + * WINECON_SetInsertMode + * + * + */ +static void WINECON_SetInsertMode(HANDLE hConIn, BOOL insert_mode) +{ + DWORD mode; + + GetConsoleMode(hConIn, &mode); + if (insert_mode) + mode |= ENABLE_INSERT_MODE | ENABLE_EXTENDED_FLAGS; + else + mode &= ~ENABLE_INSERT_MODE; + SetConsoleMode(hConIn, mode); +} + +/****************************************************************** * WINECON_GrabChanges * * A change occurs, try to figure out which @@ -399,7 +416,11 @@ void WINECON_SetConfig(struct inner_data* data, const struct config_data* cf } data->curcfg.menu_mask = cfg->menu_mask; data->curcfg.quick_edit = cfg->quick_edit; - data->curcfg.insert_mode = cfg->insert_mode; + if (data->curcfg.insert_mode != cfg->insert_mode) + { + data->curcfg.insert_mode = cfg->insert_mode; + WINECON_SetInsertMode(data->hConIn, cfg->insert_mode); + } if (1 /* FIXME: font info has changed */) { data->fnSetFont(data, cfg->face_name, cfg->cell_height, cfg->font_weight); -- 1.8.3.2