mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-07-04 04:52:47 -05:00
Reintroduce Cyrillic Caps Lock mode, which was in 0.51 but got
kicked out by the Unicode patch. It's not very good - only works sanely on US keyboards - but it's no worse than it was in 0.51. After 0.52 maybe I should fix it properly. [originally from svn r1273]
This commit is contained in:
23
window.c
23
window.c
@ -3334,6 +3334,14 @@ static int TranslateKey(UINT message, WPARAM wParam, LPARAM lParam,
|
||||
/* Okay we've done everything interesting; let windows deal with
|
||||
* the boring stuff */
|
||||
{
|
||||
BOOL capsOn=0;
|
||||
|
||||
/* helg: clear CAPS LOCK state if caps lock switches to cyrillic */
|
||||
if(cfg.xlat_capslockcyr && keystate[VK_CAPITAL] != 0) {
|
||||
capsOn= !left_alt;
|
||||
keystate[VK_CAPITAL] = 0;
|
||||
}
|
||||
|
||||
r = ToAsciiEx(wParam, scan, keystate, keys, 0, kbd_layout);
|
||||
#ifdef SHOW_TOASCII_RESULT
|
||||
if (r == 1 && !key_down) {
|
||||
@ -3402,10 +3410,17 @@ static int TranslateKey(UINT message, WPARAM wParam, LPARAM lParam,
|
||||
} else
|
||||
lpage_send(kbd_codepage, &ch, 1);
|
||||
} else {
|
||||
static char cbuf[] = "\033 ";
|
||||
cbuf[1] = ch;
|
||||
lpage_send(kbd_codepage, cbuf + !left_alt,
|
||||
1 + !!left_alt);
|
||||
if(capsOn && ch < 0x80) {
|
||||
WCHAR cbuf[2];
|
||||
cbuf[0] = 27;
|
||||
cbuf[1] = xlat_uskbd2cyrllic(ch);
|
||||
luni_send(cbuf+!left_alt, 1+!!left_alt);
|
||||
} else {
|
||||
char cbuf[2];
|
||||
cbuf[0] = '\033';
|
||||
cbuf[1] = ch;
|
||||
lpage_send(kbd_codepage, cbuf+!left_alt, 1+!!left_alt);
|
||||
}
|
||||
}
|
||||
show_mouseptr(0);
|
||||
}
|
||||
|
Reference in New Issue
Block a user