mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-04-21 21:15:03 -05:00
Jacob's patch to cause Shift to return to copy-and-paste when xterm
mouse tracking is enabled. (This can be turned off if your app really wants Shift+mouse, but it defaults to on for general usefulness.) [originally from svn r1235]
This commit is contained in:
parent
fdb6435ef9
commit
5fad95e748
1
putty.h
1
putty.h
@ -333,6 +333,7 @@ typedef struct {
|
|||||||
/* Selection options */
|
/* Selection options */
|
||||||
int mouse_is_xterm;
|
int mouse_is_xterm;
|
||||||
int rawcnp;
|
int rawcnp;
|
||||||
|
int mouse_override;
|
||||||
short wordness[256];
|
short wordness[256];
|
||||||
/* translations */
|
/* translations */
|
||||||
VT_Mode vtmode;
|
VT_Mode vtmode;
|
||||||
|
@ -233,6 +233,7 @@ void save_settings(char *section, int do_host, Config * cfg)
|
|||||||
}
|
}
|
||||||
write_setting_i(sesskey, "RawCNP", cfg->rawcnp);
|
write_setting_i(sesskey, "RawCNP", cfg->rawcnp);
|
||||||
write_setting_i(sesskey, "MouseIsXterm", cfg->mouse_is_xterm);
|
write_setting_i(sesskey, "MouseIsXterm", cfg->mouse_is_xterm);
|
||||||
|
write_setting_i(sesskey, "MouseOverride", cfg->mouse_override);
|
||||||
for (i = 0; i < 256; i += 32) {
|
for (i = 0; i < 256; i += 32) {
|
||||||
char buf[20], buf2[256];
|
char buf[20], buf2[256];
|
||||||
int j;
|
int j;
|
||||||
@ -432,6 +433,7 @@ void load_settings(char *section, int do_host, Config * cfg)
|
|||||||
}
|
}
|
||||||
gppi(sesskey, "RawCNP", 0, &cfg->rawcnp);
|
gppi(sesskey, "RawCNP", 0, &cfg->rawcnp);
|
||||||
gppi(sesskey, "MouseIsXterm", 0, &cfg->mouse_is_xterm);
|
gppi(sesskey, "MouseIsXterm", 0, &cfg->mouse_is_xterm);
|
||||||
|
gppi(sesskey, "MouseOverride", 1, &cfg->mouse_override);
|
||||||
for (i = 0; i < 256; i += 32) {
|
for (i = 0; i < 256; i += 32) {
|
||||||
static char *defaults[] = {
|
static char *defaults[] = {
|
||||||
"0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0",
|
"0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0",
|
||||||
|
@ -3100,7 +3100,7 @@ void term_mouse(Mouse_Button b, Mouse_Action a, int x, int y,
|
|||||||
if ((ldata[cols] & LATTR_MODE) != LATTR_NORM)
|
if ((ldata[cols] & LATTR_MODE) != LATTR_NORM)
|
||||||
selpoint.x /= 2;
|
selpoint.x /= 2;
|
||||||
|
|
||||||
if (xterm_mouse) {
|
if (xterm_mouse && !(cfg.mouse_override && shift)) {
|
||||||
int encstate = 0, r, c;
|
int encstate = 0, r, c;
|
||||||
char abuf[16];
|
char abuf[16];
|
||||||
static int is_down = 0;
|
static int is_down = 0;
|
||||||
|
11
windlg.c
11
windlg.c
@ -470,6 +470,7 @@ enum { IDCX_ABOUT =
|
|||||||
IDC_MBSTATIC,
|
IDC_MBSTATIC,
|
||||||
IDC_MBWINDOWS,
|
IDC_MBWINDOWS,
|
||||||
IDC_MBXTERM,
|
IDC_MBXTERM,
|
||||||
|
IDC_MOUSEOVERRIDE,
|
||||||
IDC_CCSTATIC,
|
IDC_CCSTATIC,
|
||||||
IDC_CCLIST,
|
IDC_CCLIST,
|
||||||
IDC_CCSET,
|
IDC_CCSET,
|
||||||
@ -749,6 +750,7 @@ static void init_dlg_ctrls(HWND hwnd, int keepsess)
|
|||||||
|
|
||||||
CheckRadioButton(hwnd, IDC_MBWINDOWS, IDC_MBXTERM,
|
CheckRadioButton(hwnd, IDC_MBWINDOWS, IDC_MBXTERM,
|
||||||
cfg.mouse_is_xterm ? IDC_MBXTERM : IDC_MBWINDOWS);
|
cfg.mouse_is_xterm ? IDC_MBXTERM : IDC_MBWINDOWS);
|
||||||
|
CheckDlgButton(hwnd, IDC_MOUSEOVERRIDE, cfg.mouse_override);
|
||||||
CheckDlgButton(hwnd, IDC_RAWCNP, cfg.rawcnp);
|
CheckDlgButton(hwnd, IDC_RAWCNP, cfg.rawcnp);
|
||||||
{
|
{
|
||||||
static int tabs[4] = { 25, 61, 96, 128 };
|
static int tabs[4] = { 25, 61, 96, 128 };
|
||||||
@ -1108,7 +1110,7 @@ static void create_controls(HWND hwnd, int dlgtype, int panel)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (panel == selectionpanelstart) {
|
if (panel == selectionpanelstart) {
|
||||||
/* The Selection panel. Accelerators used: [acgo] d wx hst */
|
/* The Selection panel. Accelerators used: [acgo] d wxp hst */
|
||||||
struct ctlpos cp;
|
struct ctlpos cp;
|
||||||
ctlposinit(&cp, hwnd, 80, 3, 13);
|
ctlposinit(&cp, hwnd, 80, 3, 13);
|
||||||
bartitle(&cp, "Options controlling copy and paste",
|
bartitle(&cp, "Options controlling copy and paste",
|
||||||
@ -1125,6 +1127,9 @@ static void create_controls(HWND hwnd, int dlgtype, int panel)
|
|||||||
"&Windows (Right pastes, Middle extends)", IDC_MBWINDOWS,
|
"&Windows (Right pastes, Middle extends)", IDC_MBWINDOWS,
|
||||||
"&xterm (Right extends, Middle pastes)", IDC_MBXTERM,
|
"&xterm (Right extends, Middle pastes)", IDC_MBXTERM,
|
||||||
NULL);
|
NULL);
|
||||||
|
checkbox(&cp,
|
||||||
|
"Shift overrides a&pplication's use of mouse",
|
||||||
|
IDC_MOUSEOVERRIDE);
|
||||||
endbox(&cp);
|
endbox(&cp);
|
||||||
beginbox(&cp, "Control the select-one-word-at-a-time mode",
|
beginbox(&cp, "Control the select-one-word-at-a-time mode",
|
||||||
IDC_BOX_SELECTION3);
|
IDC_BOX_SELECTION3);
|
||||||
@ -2334,10 +2339,14 @@ static int GenericMainDlgProc(HWND hwnd, UINT msg,
|
|||||||
break;
|
break;
|
||||||
case IDC_RAWCNP:
|
case IDC_RAWCNP:
|
||||||
cfg.rawcnp = IsDlgButtonChecked(hwnd, IDC_RAWCNP);
|
cfg.rawcnp = IsDlgButtonChecked(hwnd, IDC_RAWCNP);
|
||||||
|
break;
|
||||||
case IDC_MBWINDOWS:
|
case IDC_MBWINDOWS:
|
||||||
case IDC_MBXTERM:
|
case IDC_MBXTERM:
|
||||||
cfg.mouse_is_xterm = IsDlgButtonChecked(hwnd, IDC_MBXTERM);
|
cfg.mouse_is_xterm = IsDlgButtonChecked(hwnd, IDC_MBXTERM);
|
||||||
break;
|
break;
|
||||||
|
case IDC_MOUSEOVERRIDE:
|
||||||
|
cfg.mouse_override = IsDlgButtonChecked(hwnd, IDC_MOUSEOVERRIDE);
|
||||||
|
break;
|
||||||
case IDC_CCSET:
|
case IDC_CCSET:
|
||||||
{
|
{
|
||||||
BOOL ok;
|
BOOL ok;
|
||||||
|
3
window.c
3
window.c
@ -1129,7 +1129,8 @@ static void click(Mouse_Button b, int x, int y, int shift, int ctrl)
|
|||||||
{
|
{
|
||||||
int thistime = GetMessageTime();
|
int thistime = GetMessageTime();
|
||||||
|
|
||||||
if (send_raw_mouse) {
|
if (send_raw_mouse && !(cfg.mouse_override && shift)) {
|
||||||
|
lastbtn = MBT_NOTHING;
|
||||||
term_mouse(b, MA_CLICK, x, y, shift, ctrl);
|
term_mouse(b, MA_CLICK, x, y, shift, ctrl);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user