Diff

Differences From Artifact [6e4af37c41]:

To Artifact [b66f3aa5c0]:


1886
1887
1888
1889
1890
1891
1892


1893
1894
1895
1896

1897
1898
1899
1900
1901
1902
1903
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897

1898
1899
1900
1901
1902
1903
1904
1905







+
+



-
+







static int TranslateKey(UINT message, WPARAM wParam, LPARAM lParam,
			unsigned char *output) {
    BYTE keystate[256];
    int  scan, left_alt = 0, key_down, shift_state;
    int  r, i, code;
    unsigned char * p = output;

    HKL kbd_layout = GetKeyboardLayout(0);

    static WORD keys[3];
    static int compose_char = 0;
    static WPARAM compose_key = 0;

    
    r = GetKeyboardState(keystate);
    if (!r) memset(keystate, 0, sizeof(keystate));
    else
    {
#if 0
       {  /* Tell us all about key events */
	  static BYTE oldstate[256];
1922
1923
1924
1925
1926
1927
1928
1929

1930
1931
1932
1933
1934
1935
1936
1924
1925
1926
1927
1928
1929
1930

1931
1932
1933
1934
1935
1936
1937
1938







-
+







	     case VK_MENU:    debug(("ALT")); break;
	     default:         debug(("VK_%02x", wParam));
	     }
	     if(message == WM_SYSKEYDOWN || message == WM_SYSKEYUP)
		debug(("*"));
	     debug((", S%02x", scan=(HIWORD(lParam) & 0xFF) ));

	     ch = MapVirtualKey(wParam, 2);
	     ch = MapVirtualKeyEx(wParam, 2, kbd_layout);
	     if (ch>=' ' && ch<='~') debug((", '%c'", ch));
	     else if (ch)            debug((", $%02x", ch));

	     if (keys[0]) debug((", KB0=%02x", keys[0]));
	     if (keys[1]) debug((", KB1=%02x", keys[1]));
	     if (keys[2]) debug((", KB2=%02x", keys[2]));

2306
2307
2308
2309
2310
2311
2312
2313

2314
2315
2316
2317
2318
2319
2320
2308
2309
2310
2311
2312
2313
2314

2315
2316
2317
2318
2319
2320
2321
2322







-
+







    {
	BOOL capsOn=keystate[VK_CAPITAL] !=0;

	/* helg: clear CAPS LOCK state if caps lock switches to cyrillic */
	if(cfg.xlat_capslockcyr)
	    keystate[VK_CAPITAL] = 0;

	r = ToAscii (wParam, scan, keystate, keys, 0);
	r = ToAsciiEx(wParam, scan, keystate, keys, 0, kbd_layout);
	if(r>0)
	{
	    p = output;
	    for(i=0; i<r; i++)
	    {
		unsigned char ch = (unsigned char)keys[i];