Commit 6fe38e56 authored by Pascal Lessard's avatar Pascal Lessard Committed by Alexandre Julliard

The backspace is now handled in the WM_CHAR message.

parent 1cc0a9a2
...@@ -2889,6 +2889,8 @@ static BOOL EDIT_EM_Undo(WND *wnd, EDITSTATE *es) ...@@ -2889,6 +2889,8 @@ static BOOL EDIT_EM_Undo(WND *wnd, EDITSTATE *es)
*/ */
static void EDIT_WM_Char(WND *wnd, EDITSTATE *es, CHAR c, DWORD key_data) static void EDIT_WM_Char(WND *wnd, EDITSTATE *es, CHAR c, DWORD key_data)
{ {
BOOL control = GetKeyState(VK_CONTROL) & 0x8000;
switch (c) { switch (c) {
case '\r': case '\r':
case '\n': case '\n':
...@@ -2904,6 +2906,18 @@ static void EDIT_WM_Char(WND *wnd, EDITSTATE *es, CHAR c, DWORD key_data) ...@@ -2904,6 +2906,18 @@ static void EDIT_WM_Char(WND *wnd, EDITSTATE *es, CHAR c, DWORD key_data)
if ((es->style & ES_MULTILINE) && !(es->style & ES_READONLY)) if ((es->style & ES_MULTILINE) && !(es->style & ES_READONLY))
EDIT_EM_ReplaceSel(wnd, es, TRUE, "\t"); EDIT_EM_ReplaceSel(wnd, es, TRUE, "\t");
break; break;
case VK_BACK:
if (!(es->style & ES_READONLY) && !control) {
if (es->selection_start != es->selection_end)
EDIT_WM_Clear(wnd, es);
else {
/* delete character left of caret */
EDIT_EM_SetSel(wnd, es, -1, 0, FALSE);
EDIT_MoveBackward(wnd, es, TRUE);
EDIT_WM_Clear(wnd, es);
}
}
break;
default: default:
if (!(es->style & ES_READONLY) && ((BYTE)c >= ' ') && (c != 127)) { if (!(es->style & ES_READONLY) && ((BYTE)c >= ' ') && (c != 127)) {
char str[2]; char str[2];
...@@ -3384,18 +3398,6 @@ static LRESULT EDIT_WM_KeyDown(WND *wnd, EDITSTATE *es, INT key, DWORD key_data) ...@@ -3384,18 +3398,6 @@ static LRESULT EDIT_WM_KeyDown(WND *wnd, EDITSTATE *es, INT key, DWORD key_data)
if (es->style & ES_MULTILINE) if (es->style & ES_MULTILINE)
EDIT_MovePageDown_ML(wnd, es, shift); EDIT_MovePageDown_ML(wnd, es, shift);
break; break;
case VK_BACK:
if (!(es->style & ES_READONLY) && !control) {
if (es->selection_start != es->selection_end)
EDIT_WM_Clear(wnd, es);
else {
/* delete character left of caret */
EDIT_EM_SetSel(wnd, es, -1, 0, FALSE);
EDIT_MoveBackward(wnd, es, TRUE);
EDIT_WM_Clear(wnd, es);
}
}
break;
case VK_DELETE: case VK_DELETE:
if (!(es->style & ES_READONLY) && !(shift && control)) { if (!(es->style & ES_READONLY) && !(shift && control)) {
if (es->selection_start != es->selection_end) { if (es->selection_start != es->selection_end) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment