"Shane Shields" locutusenterprises@softhome.net wrote:
X11 team tends to remove more than 2 characters per keysym. See /etc/X11/xkb/symbols/tr. Turkish keyboard layout in Wine has more than 2 for some of them. Just do 'setxkbmap tr' and run Wine with +key,keyboard,+x11drv and look for mismatches.
I have done that and piped the output to a logfile. Attached is an abbreviated version with just the icelandic and turkish detection included. It seems to be mismatching on detecting the third keysym where the key is defined in /etc/X11/xkb/symbols/tr this could be a clue :)
15 mismatches per layout is too much. Isn't it?
TRACE_(key)("mismatch for keysym 0x%04lX, keycode %d,
in function X11DRV_KEYBOARD_DetectLayout where it should be
TRACE_(key)("mismatch for keysym 0x%08lX, keycode %d,
0x%04lX doesn't mean a truncation to 4 characters in format.
or my version of X11 is returning a larger value than it should. I suspect this because of the large amount of calls to the function KEYBOARD_MapDeadKeysym. Maybe the X11 guys have changed a short to a long somewhere in my version of X11 (cvs 2003-11-24) or my gcc (3.2.2) has defined them differently. If that is the case then the line
ckey[i] = keysym & 0xFF;
This piece of code gets executed only if XKB is disabled or couldn't translate keysym to a character.
On Wednesday 21 January 2004 9:03 am, you wrote:
I have done that and piped the output to a logfile. Attached is an abbreviated version with just the icelandic and turkish detection included. It seems to be mismatching on detecting the third keysym where the key is defined in /etc/X11/xkb/symbols/tr this could be a clue :)
15 mismatches per layout is too much. Isn't it?
I dont know, is it? :) I would have thought that for a turkish keyboard (or any language and the appropriate definition for that matter) should have no mismatches. It is even stranger that a different layout gets a higher score and gets chosen instead. Eg. For a Turkish keyboard.
trace:keyboard:X11DRV_KEYBOARD_DetectLayout Attempting to match against "Icelandic keyboard layout" trace:keyboard:X11DRV_KEYBOARD_DetectLayout matches=39, mismatches=9, seq=36, score=42
trace:keyboard:X11DRV_KEYBOARD_DetectLayout Attempting to match against "Turkish keyboard layout" trace:keyboard:X11DRV_KEYBOARD_DetectLayout matches=33, mismatches=15, seq=33, score=6
Thats what I would like to fix if noone wants to. I just need to make sure I understand the code properly. As you know I supplied a patch that produced the correct result whereas you said.
"The patch is wrong, since it cures just a symptom not the problem itself. There are two problems with current x11drv keyboard code: 1. Very likely that Turkish keyboard layout there is incorrect. 2. As stated before the keyboard code should be fixed to take into account the real keyboard layout while building the keyc2vkey map, not the hardcoded one."
I have verified that (No. 1) the Turkish keyboard layout is correct so I am now trying to work on No. 2.
TRACE_(key)("mismatch for keysym 0x%04lX, keycode %d,
in function X11DRV_KEYBOARD_DetectLayout where it should be
TRACE_(key)("mismatch for keysym 0x%08lX, keycode %d,
0x%04lX doesn't mean a truncation to 4 characters in format.
I just checked my books and I confused C's printf and C++'s stream formatting. I should sleep more and get more CCCCC's :).
ckey[i] = keysym & 0xFF;
This piece of code gets executed only if XKB is disabled or couldn't translate keysym to a character.
And according to the piped output it is not going there either so I am at a loss for the moment. What I have been doing so far is compiling cvs as an rpm and installing it that way. Is it possible to compile and test without actually installing wine? And when a change is made to just compile and link the relevent section? At the moment whenever I want to test something it is a two hour compile and install just to check a two minute change. I also want to be able to step through the code too.