Mikołaj Zalewski wrote:
diff --git a/programs/wineconsole/user.c b/programs/wineconsole/user.c index c4250e5..19a1625 100644 --- a/programs/wineconsole/user.c +++ b/programs/wineconsole/user.c @@ -705,6 +705,12 @@ static void WCUSER_CopySelectionToClipbo CloseClipboard(); }
+static void WCUSER_EndSelection(const struct inner_data* data) +{
- PRIVATE(data)->has_selection = FALSE;
- WCUSER_SetSelection(data, 0);
+}
/******************************************************************
WCUSER_PasteFromClipboard
@@ -935,15 +941,22 @@ static void WCUSER_HandleSelectionKey(st
if (!down) return;
- if (PRIVATE(data)->mouse_selection)
- {
if (state == 0 && wParam == VK_RETURN)
WCUSER_CopySelectionToClipboard(data);
WCUSER_EndSelection(data);
return;
- }
- switch (state) { case 0: switch (wParam) { case VK_RETURN:
PRIVATE(data)->has_selection = FALSE;
WCUSER_SetSelection(data, 0); WCUSER_CopySelectionToClipboard(data);
WCUSER_EndSelection(data); break; case VK_RIGHT: c1 = PRIVATE(data)->selectPt1;
@@ -1131,6 +1144,7 @@ static LRESULT CALLBACK WCUSER_Proc(HWND SetCapture(PRIVATE(data)->hWnd); WCUSER_SetSelection(data, 0); PRIVATE(data)->has_selection = TRUE;
PRIVATE(data)->mouse_selection = TRUE; } } else
@@ -1292,6 +1306,7 @@ static LRESULT CALLBACK WCUSER_Proc(HWND PRIVATE(data)->selectPt2.X = PRIVATE(data)->selectPt2.Y = 0; WCUSER_SetSelection(data, 0); PRIVATE(data)->has_selection = TRUE;
case IDS_COPY: if (PRIVATE(data)->has_selection)PRIVATE(data)->mouse_selection = FALSE; break;
diff --git a/programs/wineconsole/winecon_user.h b/programs/wineconsole/winecon_user.h index aa86338..1744fcd 100644 --- a/programs/wineconsole/winecon_user.h +++ b/programs/wineconsole/winecon_user.h @@ -37,6 +37,7 @@ struct inner_data_user {
HBITMAP cursor_bitmap; /* bitmap used for the caret */ BOOL has_selection; /* an area is being selected (selectPt[12] are edges of the rect) */
- BOOL mouse_selection;/* the selection was made with a mouse */ COORD selectPt1; /* start (and end) point of a mouse selection */ COORD selectPt2;
};
as a principle, why do oppose keyboard selection to mouse selection looks to me you could in principle do both... so any key except return, arrow keys should end the selection and you woun't need the extraneous mouse_selection
as a principle, why do oppose keyboard selection to mouse selection looks to me you could in principle do both... so any key except return, arrow keys should end the selection and you woun't need the extraneous mouse_selection
I wanted to make it in the same way as on Windows. But I think it's a good idea to allow keyboard movements on mouse selections and always canceling the selection with the keyboard. I'll rewrite the patch and resend it.
Mikolaj Zalewski