1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
|
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
|
-
+
|
}
sfree(logpal);
/*
* Flush the line discipline's edit buffer in the
* case where local editing has just been disabled.
*/
ldisc_send(NULL, 0);
ldisc_send(NULL, 0, 0);
if (pal)
DeleteObject(pal);
logpal = NULL;
pal = NULL;
cfgtopalette();
init_palette();
|
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
|
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
|
-
+
|
* We need not bother about stdin backlogs
* here, because in GUI PuTTY we can't do
* anything about it anyway; there's no means
* of asking Windows to hold off on KEYDOWN
* messages. We _have_ to buffer everything
* we're sent.
*/
ldisc_send(buf, len);
ldisc_send(buf, len, 1);
show_mouseptr(0);
}
}
}
return 0;
case WM_INPUTLANGCHANGE:
{
|
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
|
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
|
-
+
-
+
-
+
-
+
|
hIMC = ImmGetContext(hwnd);
n = ImmGetCompositionStringW(hIMC, GCS_RESULTSTR, NULL, 0);
if (n > 0) {
buff = (char*) smalloc(n);
ImmGetCompositionStringW(hIMC, GCS_RESULTSTR, buff, n);
luni_send((unsigned short *)buff, n / 2);
luni_send((unsigned short *)buff, n / 2, 1);
free(buff);
}
ImmReleaseContext(hwnd, hIMC);
return 1;
}
case WM_IME_CHAR:
if (wParam & 0xFF00) {
unsigned char buf[2];
buf[1] = wParam;
buf[0] = wParam >> 8;
lpage_send(kbd_codepage, buf, 2);
lpage_send(kbd_codepage, buf, 2, 1);
} else {
char c = (unsigned char) wParam;
lpage_send(kbd_codepage, &c, 1);
lpage_send(kbd_codepage, &c, 1, 1);
}
return (0);
case WM_CHAR:
case WM_SYSCHAR:
/*
* Nevertheless, we are prepared to deal with WM_CHAR
* messages, should they crop up. So if someone wants to
* post the things to us as part of a macro manoeuvre,
* we're ready to cope.
*/
{
char c = (unsigned char)wParam;
lpage_send(CP_ACP, &c, 1);
lpage_send(CP_ACP, &c, 1, 1);
}
return 0;
case WM_SETCURSOR:
if (send_raw_mouse && LOWORD(lParam) == HTCLIENT) {
SetCursor(LoadCursor(NULL, IDC_ARROW));
return TRUE;
}
|
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
|
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
|
-
+
-
+
-
+
-
+
-
+
-
+
|
compose_state = 0;
if ((nc = check_compose(compose_char, ch)) == -1) {
MessageBeep(MB_ICONHAND);
return 0;
}
keybuf = nc;
luni_send(&keybuf, 1);
luni_send(&keybuf, 1, 1);
continue;
}
compose_state = 0;
if (!key_down) {
if (alt_sum) {
if (in_utf || dbcs_screenfont) {
keybuf = alt_sum;
luni_send(&keybuf, 1);
luni_send(&keybuf, 1, 1);
} else {
ch = (char) alt_sum;
/*
* We need not bother about stdin
* backlogs here, because in GUI PuTTY
* we can't do anything about it
* anyway; there's no means of asking
* Windows to hold off on KEYDOWN
* messages. We _have_ to buffer
* everything we're sent.
*/
ldisc_send(&ch, 1);
ldisc_send(&ch, 1, 1);
}
alt_sum = 0;
} else
lpage_send(kbd_codepage, &ch, 1);
lpage_send(kbd_codepage, &ch, 1, 1);
} else {
if(capsOn && ch < 0x80) {
WCHAR cbuf[2];
cbuf[0] = 27;
cbuf[1] = xlat_uskbd2cyrllic(ch);
luni_send(cbuf+!left_alt, 1+!!left_alt);
luni_send(cbuf+!left_alt, 1+!!left_alt, 1);
} else {
char cbuf[2];
cbuf[0] = '\033';
cbuf[1] = ch;
lpage_send(kbd_codepage, cbuf+!left_alt, 1+!!left_alt);
lpage_send(kbd_codepage, cbuf+!left_alt, 1+!!left_alt, 1);
}
}
show_mouseptr(0);
}
/* This is so the ALT-Numpad and dead keys work correctly. */
keys[0] = 0;
|