| ︙ | | | ︙ | |
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
|
#define IDM_SAVEDSESS 0x0150
#define IDM_SAVED_MIN 0x1000
#define IDM_SAVED_MAX 0x2000
#define WM_IGNORE_SIZE (WM_XUSER + 1)
#define WM_IGNORE_CLIP (WM_XUSER + 2)
#define WM_IGNORE_KEYMENU (WM_XUSER + 3)
static LRESULT CALLBACK WndProc (HWND, UINT, WPARAM, LPARAM);
static int TranslateKey(UINT message, WPARAM wParam, LPARAM lParam, unsigned char *output);
static void cfgtopalette(void);
static void init_palette(void);
static void init_fonts(int);
|
<
|
38
39
40
41
42
43
44
45
46
47
48
49
50
51
|
#define IDM_SAVEDSESS 0x0150
#define IDM_SAVED_MIN 0x1000
#define IDM_SAVED_MAX 0x2000
#define WM_IGNORE_SIZE (WM_XUSER + 1)
#define WM_IGNORE_CLIP (WM_XUSER + 2)
static LRESULT CALLBACK WndProc (HWND, UINT, WPARAM, LPARAM);
static int TranslateKey(UINT message, WPARAM wParam, LPARAM lParam, unsigned char *output);
static void cfgtopalette(void);
static void init_palette(void);
static void init_fonts(int);
|
| ︙ | | | ︙ | |
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
|
}
static LRESULT CALLBACK WndProc (HWND hwnd, UINT message,
WPARAM wParam, LPARAM lParam) {
HDC hdc;
static int ignore_size = FALSE;
static int ignore_clip = FALSE;
static int ignore_keymenu = TRUE;
static int just_reconfigged = FALSE;
static int resizing = FALSE;
switch (message) {
case WM_TIMER:
if (pending_netevent)
enact_pending_netevent();
|
<
|
950
951
952
953
954
955
956
957
958
959
960
961
962
963
|
}
static LRESULT CALLBACK WndProc (HWND hwnd, UINT message,
WPARAM wParam, LPARAM lParam) {
HDC hdc;
static int ignore_size = FALSE;
static int ignore_clip = FALSE;
static int just_reconfigged = FALSE;
static int resizing = FALSE;
switch (message) {
case WM_TIMER:
if (pending_netevent)
enact_pending_netevent();
|
| ︙ | | | ︙ | |
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
|
DestroyWindow(hwnd);
return 0;
case WM_DESTROY:
PostQuitMessage (0);
return 0;
case WM_SYSCOMMAND:
switch (wParam & ~0xF) { /* low 4 bits reserved to Windows */
case SC_KEYMENU:
if (ignore_keymenu)
return 0; /* don't put up system menu on Alt */
break;
case IDM_SHOWLOG:
showeventlog(hwnd);
break;
case IDM_NEWSESS:
case IDM_DUPSESS:
case IDM_SAVEDSESS:
{
|
<
<
<
<
|
975
976
977
978
979
980
981
982
983
984
985
986
987
988
|
DestroyWindow(hwnd);
return 0;
case WM_DESTROY:
PostQuitMessage (0);
return 0;
case WM_SYSCOMMAND:
switch (wParam & ~0xF) { /* low 4 bits reserved to Windows */
case IDM_SHOWLOG:
showeventlog(hwnd);
break;
case IDM_NEWSESS:
case IDM_DUPSESS:
case IDM_SAVEDSESS:
{
|
| ︙ | | | ︙ | |
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
|
term_mouse (b, MA_DRAG, TO_CHR_X(X_POS(lParam)),
TO_CHR_Y(Y_POS(lParam)));
}
return 0;
case WM_IGNORE_CLIP:
ignore_clip = wParam; /* don't panic on DESTROYCLIPBOARD */
break;
case WM_IGNORE_KEYMENU:
ignore_keymenu = wParam; /* do or don't ignore SC_KEYMENU */
break;
case WM_DESTROYCLIPBOARD:
if (!ignore_clip)
term_deselect();
ignore_clip = FALSE;
return 0;
case WM_PAINT:
{
|
<
<
<
|
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
|
term_mouse (b, MA_DRAG, TO_CHR_X(X_POS(lParam)),
TO_CHR_Y(Y_POS(lParam)));
}
return 0;
case WM_IGNORE_CLIP:
ignore_clip = wParam; /* don't panic on DESTROYCLIPBOARD */
break;
case WM_DESTROYCLIPBOARD:
if (!ignore_clip)
term_deselect();
ignore_clip = FALSE;
return 0;
case WM_PAINT:
{
|
| ︙ | | | ︙ | |
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
|
return 0;
}
if (left_alt && wParam == VK_F4 && cfg.alt_f4) {
return -1;
}
if (left_alt && wParam == VK_SPACE && cfg.alt_space) {
SendMessage (hwnd, WM_IGNORE_KEYMENU, FALSE, 0);
SendMessage (hwnd, WM_SYSCOMMAND, SC_KEYMENU, 0);
SendMessage (hwnd, WM_IGNORE_KEYMENU, TRUE, 0);
return -1;
}
/* Nethack keypad */
if (cfg.nethack_keypad && !left_alt) {
switch(wParam) {
case VK_NUMPAD1: *p++ = shift_state ? 'B': 'b'; return p-output;
|
<
<
|
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
|
return 0;
}
if (left_alt && wParam == VK_F4 && cfg.alt_f4) {
return -1;
}
if (left_alt && wParam == VK_SPACE && cfg.alt_space) {
SendMessage (hwnd, WM_SYSCOMMAND, SC_KEYMENU, 0);
return -1;
}
/* Nethack keypad */
if (cfg.nethack_keypad && !left_alt) {
switch(wParam) {
case VK_NUMPAD1: *p++ = shift_state ? 'B': 'b'; return p-output;
|
| ︙ | | | ︙ | |
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
|
keys[0] = 0;
return p-output;
}
}
/* This stops ALT press-release doing a 'COMMAND MENU' function */
#if 0
if (message == WM_SYSKEYUP && wParam == VK_MENU)
{
keystate[VK_MENU] = 0;
return 0;
}
#endif
return -1;
}
void set_title (char *title) {
sfree (window_name);
window_name = smalloc(1+strlen(title));
|
<
<
|
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
|
keys[0] = 0;
return p-output;
}
}
/* This stops ALT press-release doing a 'COMMAND MENU' function */
if (message == WM_SYSKEYUP && wParam == VK_MENU)
{
keystate[VK_MENU] = 0;
return 0;
}
return -1;
}
void set_title (char *title) {
sfree (window_name);
window_name = smalloc(1+strlen(title));
|
| ︙ | | | ︙ | |