1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-07-01 03:22:48 -05:00

Cleanup: make an enum for the values of CONF_mouse_is_xterm.

Again, there's no sensible reason why these should be written at the
point of use as bare integers.
This commit is contained in:
Simon Tatham
2023-05-29 15:52:32 +01:00
parent fd9bc8c86a
commit 5e055a374f
2 changed files with 10 additions and 3 deletions

View File

@ -2046,10 +2046,10 @@ static Mouse_Button translate_button(WinGuiSeat *wgs, Mouse_Button button)
if (button == MBT_LEFT)
return MBT_SELECT;
if (button == MBT_MIDDLE)
return conf_get_int(wgs->conf, CONF_mouse_is_xterm) == 1 ?
return conf_get_int(wgs->conf, CONF_mouse_is_xterm) == MOUSE_XTERM ?
MBT_PASTE : MBT_EXTEND;
if (button == MBT_RIGHT)
return conf_get_int(wgs->conf, CONF_mouse_is_xterm) == 1 ?
return conf_get_int(wgs->conf, CONF_mouse_is_xterm) == MOUSE_XTERM ?
MBT_EXTEND : MBT_PASTE;
return 0; /* shouldn't happen */
}
@ -2603,7 +2603,7 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT message,
case WM_RBUTTONUP:
if (message == WM_RBUTTONDOWN &&
((wParam & MK_CONTROL) ||
(conf_get_int(wgs->conf, CONF_mouse_is_xterm) == 2))) {
(conf_get_int(wgs->conf, CONF_mouse_is_xterm) == MOUSE_WINDOWS))) {
POINT cursorpos;
/* Just in case this happened in mid-select */