~mdw
/
sgt
/
putty
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Rectangular-block selection. Enabled by Alt+drag, unless you
[sgt/putty]
/
window.c
diff --git
a/window.c
b/window.c
index
c0e7f3e
..
9e09223
100644
(file)
--- a/
window.c
+++ b/
window.c
@@
-10,7
+10,7
@@
#endif
#endif
#endif
#endif
-#if
WINVER < 0x0500
+#if
(WINVER < 0x0500) && !defined(NO_MULTIMON)
#define COMPILE_MULTIMON_STUBS
#include <multimon.h>
#endif
#define COMPILE_MULTIMON_STUBS
#include <multimon.h>
#endif
@@
-1335,13
+1335,13
@@
static void reset_window(int reinit) {
}
}
}
}
-static void click(Mouse_Button b, int x, int y, int shift, int ctrl)
+static void click(Mouse_Button b, int x, int y, int shift, int ctrl
, int alt
)
{
int thistime = GetMessageTime();
if (send_raw_mouse && !(cfg.mouse_override && shift)) {
lastbtn = MBT_NOTHING;
{
int thistime = GetMessageTime();
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
, alt
);
return;
}
return;
}
@@
-1354,7
+1354,7
@@
static void click(Mouse_Button b, int x, int y, int shift, int ctrl)
lastact = MA_CLICK;
}
if (lastact != MA_NOTHING)
lastact = MA_CLICK;
}
if (lastact != MA_NOTHING)
- term_mouse(b, lastact, x, y, shift, ctrl);
+ term_mouse(b, lastact, x, y, shift, ctrl
, alt
);
lasttime = thistime;
}
lasttime = thistime;
}
@@
-1385,6
+1385,19
@@
static void show_mouseptr(int show)
cursor_visible = show;
}
cursor_visible = show;
}
+static int is_alt_pressed(void)
+{
+ BYTE keystate[256];
+ int r = GetKeyboardState(keystate);
+ if (!r)
+ return FALSE;
+ if (keystate[VK_MENU] & 0x80)
+ return TRUE;
+ if (keystate[VK_RMENU] & 0x80)
+ return TRUE;
+ return FALSE;
+}
+
static LRESULT CALLBACK WndProc(HWND hwnd, UINT message,
WPARAM wParam, LPARAM lParam)
{
static LRESULT CALLBACK WndProc(HWND hwnd, UINT message,
WPARAM wParam, LPARAM lParam)
{
@@
-1410,6
+1423,7
@@
static LRESULT CALLBACK WndProc(HWND hwnd, UINT message,
last_movement = now;
}
}
last_movement = now;
}
}
+ net_pending_errors();
return 0;
case WM_CREATE:
break;
return 0;
case WM_CREATE:
break;
@@
-1614,6
+1628,7
@@
static LRESULT CALLBACK WndProc(HWND hwnd, UINT message,
InvalidateRect(hwnd, NULL, TRUE);
reset_window(init_lvl);
InvalidateRect(hwnd, NULL, TRUE);
reset_window(init_lvl);
+ net_pending_errors();
}
break;
case IDM_COPYALL:
}
break;
case IDM_COPYALL:
@@
-1627,42
+1642,55
@@
static LRESULT CALLBACK WndProc(HWND hwnd, UINT message,
break;
case IDM_TEL_AYT:
back->special(TS_AYT);
break;
case IDM_TEL_AYT:
back->special(TS_AYT);
+ net_pending_errors();
break;
case IDM_TEL_BRK:
back->special(TS_BRK);
break;
case IDM_TEL_BRK:
back->special(TS_BRK);
+ net_pending_errors();
break;
case IDM_TEL_SYNCH:
back->special(TS_SYNCH);
break;
case IDM_TEL_SYNCH:
back->special(TS_SYNCH);
+ net_pending_errors();
break;
case IDM_TEL_EC:
back->special(TS_EC);
break;
case IDM_TEL_EC:
back->special(TS_EC);
+ net_pending_errors();
break;
case IDM_TEL_EL:
back->special(TS_EL);
break;
case IDM_TEL_EL:
back->special(TS_EL);
+ net_pending_errors();
break;
case IDM_TEL_GA:
back->special(TS_GA);
break;
case IDM_TEL_GA:
back->special(TS_GA);
+ net_pending_errors();
break;
case IDM_TEL_NOP:
back->special(TS_NOP);
break;
case IDM_TEL_NOP:
back->special(TS_NOP);
+ net_pending_errors();
break;
case IDM_TEL_ABORT:
back->special(TS_ABORT);
break;
case IDM_TEL_ABORT:
back->special(TS_ABORT);
+ net_pending_errors();
break;
case IDM_TEL_AO:
back->special(TS_AO);
break;
case IDM_TEL_AO:
back->special(TS_AO);
+ net_pending_errors();
break;
case IDM_TEL_IP:
back->special(TS_IP);
break;
case IDM_TEL_IP:
back->special(TS_IP);
+ net_pending_errors();
break;
case IDM_TEL_SUSP:
back->special(TS_SUSP);
break;
case IDM_TEL_SUSP:
back->special(TS_SUSP);
+ net_pending_errors();
break;
case IDM_TEL_EOR:
back->special(TS_EOR);
break;
case IDM_TEL_EOR:
back->special(TS_EOR);
+ net_pending_errors();
break;
case IDM_TEL_EOF:
back->special(TS_EOF);
break;
case IDM_TEL_EOF:
back->special(TS_EOF);
+ net_pending_errors();
break;
case IDM_ABOUT:
showabout(hwnd);
break;
case IDM_ABOUT:
showabout(hwnd);
@@
-1715,14
+1743,15
@@
static LRESULT CALLBACK WndProc(HWND hwnd, UINT message,
if (send_raw_mouse) {
/* send a mouse-down followed by a mouse up */
if (send_raw_mouse) {
/* send a mouse-down followed by a mouse up */
+
term_mouse(b,
MA_CLICK,
TO_CHR_X(X_POS(lParam)),
TO_CHR_Y(Y_POS(lParam)), wParam & MK_SHIFT,
term_mouse(b,
MA_CLICK,
TO_CHR_X(X_POS(lParam)),
TO_CHR_Y(Y_POS(lParam)), wParam & MK_SHIFT,
- wParam & MK_CONTROL);
+ wParam & MK_CONTROL
, is_alt_pressed()
);
term_mouse(b, MA_RELEASE, TO_CHR_X(X_POS(lParam)),
TO_CHR_Y(Y_POS(lParam)), wParam & MK_SHIFT,
term_mouse(b, MA_RELEASE, TO_CHR_X(X_POS(lParam)),
TO_CHR_Y(Y_POS(lParam)), wParam & MK_SHIFT,
- wParam & MK_CONTROL);
+ wParam & MK_CONTROL
, is_alt_pressed()
);
} else {
/* trigger a scroll */
term_scroll(0,
} else {
/* trigger a scroll */
term_scroll(0,
@@
-1739,6
+1768,7
@@
static LRESULT CALLBACK WndProc(HWND hwnd, UINT message,
case WM_RBUTTONUP:
{
int button, press;
case WM_RBUTTONUP:
{
int button, press;
+
switch (message) {
case WM_LBUTTONDOWN:
button = MBT_LEFT;
switch (message) {
case WM_LBUTTONDOWN:
button = MBT_LEFT;
@@
-1771,13
+1801,14
@@
static LRESULT CALLBACK WndProc(HWND hwnd, UINT message,
if (press) {
click(button,
TO_CHR_X(X_POS(lParam)), TO_CHR_Y(Y_POS(lParam)),
if (press) {
click(button,
TO_CHR_X(X_POS(lParam)), TO_CHR_Y(Y_POS(lParam)),
- wParam & MK_SHIFT, wParam & MK_CONTROL);
+ wParam & MK_SHIFT, wParam & MK_CONTROL,
+ is_alt_pressed());
SetCapture(hwnd);
} else {
term_mouse(button, MA_RELEASE,
TO_CHR_X(X_POS(lParam)),
TO_CHR_Y(Y_POS(lParam)), wParam & MK_SHIFT,
SetCapture(hwnd);
} else {
term_mouse(button, MA_RELEASE,
TO_CHR_X(X_POS(lParam)),
TO_CHR_Y(Y_POS(lParam)), wParam & MK_SHIFT,
- wParam & MK_CONTROL);
+ wParam & MK_CONTROL
, is_alt_pressed()
);
ReleaseCapture();
}
}
ReleaseCapture();
}
}
@@
-1800,7
+1831,7
@@
static LRESULT CALLBACK WndProc(HWND hwnd, UINT message,
b = MBT_RIGHT;
term_mouse(b, MA_DRAG, TO_CHR_X(X_POS(lParam)),
TO_CHR_Y(Y_POS(lParam)), wParam & MK_SHIFT,
b = MBT_RIGHT;
term_mouse(b, MA_DRAG, TO_CHR_X(X_POS(lParam)),
TO_CHR_Y(Y_POS(lParam)), wParam & MK_SHIFT,
- wParam & MK_CONTROL);
+ wParam & MK_CONTROL
, is_alt_pressed()
);
}
return 0;
case WM_NCMOUSEMOVE:
}
return 0;
case WM_NCMOUSEMOVE:
@@
-2188,6
+2219,7
@@
static LRESULT CALLBACK WndProc(HWND hwnd, UINT message,
}
}
}
}
}
}
+ net_pending_errors();
return 0;
case WM_INPUTLANGCHANGE:
{
return 0;
case WM_INPUTLANGCHANGE:
{
@@
-3843,7
+3875,7
@@
static void flip_full_screen(void)
if (full_screen) {
int x, y, cx, cy;
if (full_screen) {
int x, y, cx, cy;
-#if
def MONITOR_DEFAULTTONEAREST
+#if
!defined(NO_MULTIMON) && defined(MONITOR_DEFAULTTONEAREST)
/* The multi-monitor safe way of doing things */
HMONITOR mon;
MONITORINFO mi;
/* The multi-monitor safe way of doing things */
HMONITOR mon;
MONITORINFO mi;
@@
-3887,4
+3919,3
@@
static void flip_full_screen(void)
CheckMenuItem(GetSystemMenu(hwnd, FALSE), IDM_FULLSCREEN,
MF_BYCOMMAND| full_screen ? MF_CHECKED : MF_UNCHECKED);
}
CheckMenuItem(GetSystemMenu(hwnd, FALSE), IDM_FULLSCREEN,
MF_BYCOMMAND| full_screen ? MF_CHECKED : MF_UNCHECKED);
}
-