int fontcharset;
char logfilename[FILENAME_MAX];
int logtype;
+ int hide_mouseptr;
/* Colour options */
int try_palette;
int bold_colour;
write_setting_i (sesskey, "ComposeKey", cfg->compose_key);
write_setting_i (sesskey, "LdiscTerm", cfg->ldisc_term);
write_setting_i (sesskey, "AlwaysOnTop", cfg->alwaysontop);
+ write_setting_i (sesskey, "HideMousePtr", cfg->hide_mouseptr);
write_setting_i (sesskey, "CurType", cfg->cursor_type);
write_setting_i (sesskey, "BlinkCur", cfg->blink_cur);
write_setting_i (sesskey, "Beep", cfg->beep);
gppi (sesskey, "ComposeKey", 0, &cfg->compose_key);
gppi (sesskey, "LdiscTerm", 0, &cfg->ldisc_term);
gppi (sesskey, "AlwaysOnTop", 0, &cfg->alwaysontop);
+ gppi (sesskey, "HideMousePtr", 0, &cfg->hide_mouseptr);
gppi (sesskey, "CurType", 0, &cfg->cursor_type);
gppi (sesskey, "BlinkCur", 0, &cfg->blink_cur);
gppi (sesskey, "Beep", 1, &cfg->beep);
IDC_BOX_APPEARANCE1, IDC_BOXT_APPEARANCE1,
IDC_BOX_APPEARANCE2, IDC_BOXT_APPEARANCE2,
IDC_BOX_APPEARANCE3, IDC_BOXT_APPEARANCE3,
+ IDC_BOX_APPEARANCE4, IDC_BOXT_APPEARANCE4,
IDC_CURSORSTATIC,
IDC_CURBLOCK,
IDC_CURUNDER,
IDC_WINTITLE,
IDC_WINEDIT,
IDC_WINNAME,
+ IDC_HIDEMOUSE,
appearancepanelend,
connectionpanelstart,
SetDlgItemText (hwnd, IDC_WINEDIT, cfg.wintitle);
CheckDlgButton (hwnd, IDC_WINNAME, cfg.win_name_always);
+ CheckDlgButton (hwnd, IDC_HIDEMOUSE, cfg.hide_mouseptr);
CheckRadioButton (hwnd, IDC_CURBLOCK, IDC_CURVERT,
cfg.cursor_type==0 ? IDC_CURBLOCK :
cfg.cursor_type==1 ? IDC_CURUNDER : IDC_CURVERT);
IDC_WINEDIT, 100, NULL);
checkbox(&cp, "Avoid ever using &icon title", IDC_WINNAME);
endbox(&cp);
+ beginbox(&cp, "Adjust the use of the mouse pointer",
+ IDC_BOX_APPEARANCE4, IDC_BOXT_APPEARANCE4);
+ checkbox(&cp, "Hide mouse &pointer when typing in window",
+ IDC_HIDEMOUSE);
+ endbox(&cp);
treeview_insert(&tvfaff, 1, "Appearance");
}
HIWORD(wParam) == BN_DOUBLECLICKED)
cfg.win_name_always = IsDlgButtonChecked (hwnd, IDC_WINNAME);
break;
+ case IDC_HIDEMOUSE:
+ if (HIWORD(wParam) == BN_CLICKED ||
+ HIWORD(wParam) == BN_DOUBLECLICKED)
+ cfg.hide_mouseptr = IsDlgButtonChecked (hwnd, IDC_HIDEMOUSE);
+ break;
case IDC_CURBLOCK:
if (HIWORD(wParam) == BN_CLICKED ||
HIWORD(wParam) == BN_DOUBLECLICKED)
lasttime = thistime;
}
+static void show_mouseptr(int show) {
+ static int cursor_visible = 1;
+ if (!cfg.hide_mouseptr) /* override if this feature disabled */
+ show = 1;
+ if (cursor_visible && !show)
+ ShowCursor(FALSE);
+ else if (!cursor_visible && show)
+ ShowCursor(TRUE);
+ cursor_visible = show;
+}
+
static LRESULT CALLBACK WndProc (HWND hwnd, UINT message,
WPARAM wParam, LPARAM lParam) {
HDC hdc;
case WM_CREATE:
break;
case WM_CLOSE:
+ show_mouseptr(1);
if (!cfg.warn_on_close || session_closed ||
MessageBox(hwnd, "Are you sure you want to close this session?",
"PuTTY Exit Confirmation",
DestroyWindow(hwnd);
return 0;
case WM_DESTROY:
+ show_mouseptr(1);
PostQuitMessage (0);
return 0;
case WM_SYSCOMMAND:
#define TO_CHR_Y(y) (((y)<0 ? (y)-font_height+1: (y)) / font_height)
case WM_LBUTTONDOWN:
+ show_mouseptr(1);
click (MB_SELECT, TO_CHR_X(X_POS(lParam)),
TO_CHR_Y(Y_POS(lParam)));
SetCapture(hwnd);
return 0;
case WM_LBUTTONUP:
+ show_mouseptr(1);
term_mouse (MB_SELECT, MA_RELEASE, TO_CHR_X(X_POS(lParam)),
TO_CHR_Y(Y_POS(lParam)));
ReleaseCapture();
return 0;
case WM_MBUTTONDOWN:
+ show_mouseptr(1);
SetCapture(hwnd);
click (cfg.mouse_is_xterm ? MB_PASTE : MB_EXTEND,
TO_CHR_X(X_POS(lParam)),
TO_CHR_Y(Y_POS(lParam)));
return 0;
case WM_MBUTTONUP:
+ show_mouseptr(1);
term_mouse (cfg.mouse_is_xterm ? MB_PASTE : MB_EXTEND,
MA_RELEASE, TO_CHR_X(X_POS(lParam)),
TO_CHR_Y(Y_POS(lParam)));
ReleaseCapture();
return 0;
case WM_RBUTTONDOWN:
+ show_mouseptr(1);
SetCapture(hwnd);
click (cfg.mouse_is_xterm ? MB_EXTEND : MB_PASTE,
TO_CHR_X(X_POS(lParam)),
TO_CHR_Y(Y_POS(lParam)));
return 0;
case WM_RBUTTONUP:
+ show_mouseptr(1);
term_mouse (cfg.mouse_is_xterm ? MB_EXTEND : MB_PASTE,
MA_RELEASE, TO_CHR_X(X_POS(lParam)),
TO_CHR_Y(Y_POS(lParam)));
ReleaseCapture();
return 0;
case WM_MOUSEMOVE:
+ show_mouseptr(1);
/*
* Add the mouse position and message time to the random
* number noise.
term_update();
break;
case WM_KILLFOCUS:
+ show_mouseptr(1);
has_focus = FALSE;
DestroyCaret();
term_out();
if (len == -1)
return DefWindowProc (hwnd, message, wParam, lParam);
ldisc->send (buf, len);
+
+ if (len > 0)
+ show_mouseptr(0);
}
}
return 0;