337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
|
AppendMenu (p, MF_ENABLED, IDM_TEL_AO, "Abort Output");
AppendMenu (p, MF_ENABLED, IDM_TEL_IP, "Interrupt Process");
AppendMenu (p, MF_ENABLED, IDM_TEL_SUSP, "Suspend Process");
AppendMenu (p, MF_SEPARATOR, 0, 0);
AppendMenu (p, MF_ENABLED, IDM_TEL_EOR, "End Of Record");
AppendMenu (p, MF_ENABLED, IDM_TEL_EOF, "End Of File");
AppendMenu (m, MF_POPUP | MF_ENABLED, (UINT) p, "Telnet Command");
AppendMenu (m, MF_ENABLED, IDM_SHOWLOG, "Show Negotiation");
AppendMenu (m, MF_SEPARATOR, 0, 0);
}
AppendMenu (m, MF_ENABLED, IDM_NEWSESS, "New Session");
AppendMenu (m, MF_ENABLED, IDM_DUPSESS, "Duplicate Session");
s = CreateMenu();
get_sesslist(TRUE);
for (i = 1 ; i < ((nsessions < 256) ? nsessions : 256) ; i++)
AppendMenu (s, MF_ENABLED, IDM_SAVED_MIN + (16 * i) , sessions[i]);
AppendMenu (m, MF_POPUP | MF_ENABLED, (UINT) s, "Saved Sessions");
|
<
>
>
|
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
|
AppendMenu (p, MF_ENABLED, IDM_TEL_AO, "Abort Output");
AppendMenu (p, MF_ENABLED, IDM_TEL_IP, "Interrupt Process");
AppendMenu (p, MF_ENABLED, IDM_TEL_SUSP, "Suspend Process");
AppendMenu (p, MF_SEPARATOR, 0, 0);
AppendMenu (p, MF_ENABLED, IDM_TEL_EOR, "End Of Record");
AppendMenu (p, MF_ENABLED, IDM_TEL_EOF, "End Of File");
AppendMenu (m, MF_POPUP | MF_ENABLED, (UINT) p, "Telnet Command");
AppendMenu (m, MF_SEPARATOR, 0, 0);
}
AppendMenu (m, MF_ENABLED, IDM_SHOWLOG, "Event Log");
AppendMenu (m, MF_SEPARATOR, 0, 0);
AppendMenu (m, MF_ENABLED, IDM_NEWSESS, "New Session");
AppendMenu (m, MF_ENABLED, IDM_DUPSESS, "Duplicate Session");
s = CreateMenu();
get_sesslist(TRUE);
for (i = 1 ; i < ((nsessions < 256) ? nsessions : 256) ; i++)
AppendMenu (s, MF_ENABLED, IDM_SAVED_MIN + (16 * i) , sessions[i]);
AppendMenu (m, MF_POPUP | MF_ENABLED, (UINT) s, "Saved Sessions");
|
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
|
* we get the translations under _our_ control.
*/
{
unsigned char buf[20];
int len;
len = TranslateKey (wParam, lParam, buf);
back->send (buf, len);
}
return 0;
case WM_KEYUP:
case WM_SYSKEYUP:
/*
* We handle KEYUP ourselves in order to distinghish left
|
>
>
|
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
|
* we get the translations under _our_ control.
*/
{
unsigned char buf[20];
int len;
len = TranslateKey (wParam, lParam, buf);
if (len == -1)
return DefWindowProc (hwnd, message, wParam, lParam);
back->send (buf, len);
}
return 0;
case WM_KEYUP:
case WM_SYSKEYUP:
/*
* We handle KEYUP ourselves in order to distinghish left
|
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
|
SendMessage (hwnd, WM_VSCROLL, SB_PAGEUP, 0);
return 0;
}
if (ret && (keystate[VK_SHIFT] & 0x80) && wParam == VK_NEXT) {
SendMessage (hwnd, WM_VSCROLL, SB_PAGEDOWN, 0);
return 0;
}
if ((lParam & 0x20000000) && wParam == VK_F4) {
SendMessage (hwnd, WM_CLOSE, 0, 0);
return 0;
}
/*
* In general, the strategy is to see what the Windows keymap
* translation has to say for itself, and then process function
* keys and suchlike ourselves if that fails. But first we must
* deal with the small number of special cases which the
|
|
>
>
>
|
|
|
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
|
SendMessage (hwnd, WM_VSCROLL, SB_PAGEUP, 0);
return 0;
}
if (ret && (keystate[VK_SHIFT] & 0x80) && wParam == VK_NEXT) {
SendMessage (hwnd, WM_VSCROLL, SB_PAGEDOWN, 0);
return 0;
}
if ((lParam & 0x20000000) && wParam == VK_F4 && cfg.alt_f4) {
return -1;
}
if ((lParam & 0x20000000) && wParam == VK_SPACE && cfg.alt_space) {
SendMessage (hwnd, WM_SYSCOMMAND, SC_KEYMENU, 0);
return -1;
}
/*
* In general, the strategy is to see what the Windows keymap
* translation has to say for itself, and then process function
* keys and suchlike ourselves if that fails. But first we must
* deal with the small number of special cases which the
|
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
|
* Control-Space should send ^@ (0x00), not Space.
*/
if (ret && (keystate[VK_CONTROL] & 0x80) && wParam == VK_SPACE) {
*p++ = 0x00;
return p - output;
}
/*
* If we're in applications keypad mode, we have to process it
* before char-map translation, because it will pre-empt lots
* of stuff, even if NumLock is off.
*/
if (app_keypad_keys) {
if (ret) {
/*
* Hack to ensure NumLock doesn't interfere with
* perception of Shift for Keypad Plus. I don't pretend
* to understand this, but it seems to work as is.
* Leave it alone, or die.
*/
|
>
>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
|
|
|
<
|
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
|
* Control-Space should send ^@ (0x00), not Space.
*/
if (ret && (keystate[VK_CONTROL] & 0x80) && wParam == VK_SPACE) {
*p++ = 0x00;
return p - output;
}
if (cfg.nethack_keypad) {
int shift = keystate[VK_SHIFT] & 0x80;
/*
* NB the shifted versions only work with numlock off.
*/
switch ( (lParam >> 16) & 0x1FF ) {
case 0x047: *p++ = shift ? 'Y' : 'y'; return p - output;
case 0x048: *p++ = shift ? 'K' : 'k'; return p - output;
case 0x049: *p++ = shift ? 'U' : 'u'; return p - output;
case 0x04B: *p++ = shift ? 'H' : 'h'; return p - output;
case 0x04C: *p++ = '.'; return p - output;
case 0x04D: *p++ = shift ? 'L' : 'l'; return p - output;
case 0x04F: *p++ = shift ? 'B' : 'b'; return p - output;
case 0x050: *p++ = shift ? 'J' : 'j'; return p - output;
case 0x051: *p++ = shift ? 'N' : 'n'; return p - output;
case 0x053: *p++ = '.'; return p - output;
}
} else if (app_keypad_keys) {
/*
* If we're in applications keypad mode, we have to process it
* before char-map translation, because it will pre-empt lots
* of stuff, even if NumLock is off.
*/
if (ret) {
/*
* Hack to ensure NumLock doesn't interfere with
* perception of Shift for Keypad Plus. I don't pretend
* to understand this, but it seems to work as is.
* Leave it alone, or die.
*/
|