Hi!
When running MS Word 97 I get the next error messages when I try to write some of the Hungarian characters. So I'm reporting it as requested in the message :)
err:keyboard:X11DRV_ToUnicode Please report: no char for keysym 01F5 (odoubleacute) : err:keyboard:X11DRV_ToUnicode (virtKey=DB,scanCode=1A,keycode=22,state=10) err:keyboard:X11DRV_ToUnicode Please report: no char for keysym 01FB (udoubleacute) : err:keyboard:X11DRV_ToUnicode (virtKey=DC,scanCode=2B,keycode=33,state=10)
Is it trivial to fix, or there are some problems with it? I would like if that could work... I'm also willing to code it if that is needed :)
Regards Zsolt
On Wednesday 09 October 2002 14:25, Rizsanyi Zsolt wrote:
Hi!
When running MS Word 97 I get the next error messages when I try to write some of the Hungarian characters. So I'm reporting it as requested in the message :)
err:keyboard:X11DRV_ToUnicode Please report: no char for keysym 01F5 (odoubleacute) : err:keyboard:X11DRV_ToUnicode (virtKey=DB,scanCode=1A,keycode=22,state=10) err:keyboard:X11DRV_ToUnicode Please report: no char for keysym 01FB (udoubleacute) : err:keyboard:X11DRV_ToUnicode (virtKey=DC,scanCode=2B,keycode=33,state=10)
Is it trivial to fix, or there are some problems with it? I would like if that could work... I'm also willing to code it if that is needed :)
I have investigated it, and the problem is in this code (from dlls/x11drv/keyboard.c):
else TRACE("Found keycode %d (0x%2X)\n",e.keycode,e.keycode);
ret = XLookupString(&e, (LPVOID)lpChar, 2, &keysym, NULL); wine_tsx11_unlock();
if (ret == 0) · { · BYTE dead_char;
· dead_char = KEYBOARD_MapDeadKeysym(keysym); · if (dead_char) · { · MultiByteToWideChar(main_key_tab[kbd_layout].layout_cp, 0, &dead_char, 1, bufW, bufW_siz e); · ret = -1; · } · else · { · char· *ksname;
· ksname = TSXKeysymToString(keysym); · if (!ksname) · · ksname = "No Name"; · if ((keysym >> 8) != 0xff) · · { · · ERR("Please report: no char for keysym %04lX (%s) :\n", keysym, ksname); · · ERR("(virtKey=%X,scanCode=%X,keycode=%X,state=%X)\n", virtKey, scanCode, e.keycode, e.state); · · } · } · }
The problems come from that the XLookupString is used to convert the keycode to the display string. It does properly display that the pressed key is odoubleacute, but because XLookupString works only for Latin1 characters, so the string representation is not returned.
I dont see how this situation should be handled. Maybe another X function should be used instead of XLookupString (one which works with chars other than Latin1).
I'm not too good in X programming so please HELP!!
Thanks Zsolt
I've had a similar problem. X uses the current locale in order to convert the keycode into a character. Try setting you language type to Hungarian and then report. If you don't want to set the system locale, try the following command (under bash): LANG=hu wine ....... This will set the language for one application only.
Shachar
Rizsanyi Zsolt wrote:
On Wednesday 09 October 2002 14:25, Rizsanyi Zsolt wrote:
Hi!
When running MS Word 97 I get the next error messages when I try to write some of the Hungarian characters. So I'm reporting it as requested in the message :)
err:keyboard:X11DRV_ToUnicode Please report: no char for keysym 01F5 (odoubleacute) : err:keyboard:X11DRV_ToUnicode (virtKey=DB,scanCode=1A,keycode=22,state=10) err:keyboard:X11DRV_ToUnicode Please report: no char for keysym 01FB (udoubleacute) : err:keyboard:X11DRV_ToUnicode (virtKey=DC,scanCode=2B,keycode=33,state=10)
Is it trivial to fix, or there are some problems with it? I would like if that could work... I'm also willing to code it if that is needed :)
I have investigated it, and the problem is in this code (from dlls/x11drv/keyboard.c):
else TRACE("Found keycode %d (0x%2X)\n",e.keycode,e.keycode);
ret = XLookupString(&e, (LPVOID)lpChar, 2, &keysym, NULL); wine_tsx11_unlock();
if (ret == 0) · { · BYTE dead_char;
· dead_char = KEYBOARD_MapDeadKeysym(keysym); · if (dead_char) · { · MultiByteToWideChar(main_key_tab[kbd_layout].layout_cp, 0, &dead_char, 1, bufW, bufW_siz e); · ret = -1; · } · else · { · char· *ksname;
· ksname = TSXKeysymToString(keysym); · if (!ksname) · · ksname = "No Name"; · if ((keysym >> 8) != 0xff) · · { · · ERR("Please report: no char for keysym %04lX (%s) :\n", keysym, ksname); · · ERR("(virtKey=%X,scanCode=%X,keycode=%X,state=%X)\n", virtKey, scanCode, e.keycode, e.state); · · } · } · }
The problems come from that the XLookupString is used to convert the keycode to the display string. It does properly display that the pressed key is odoubleacute, but because XLookupString works only for Latin1 characters, so the string representation is not returned.
I dont see how this situation should be handled. Maybe another X function should be used instead of XLookupString (one which works with chars other than Latin1).
I'm not too good in X programming so please HELP!!
Thanks Zsolt
On Friday 11 October 2002 18:16, Shachar Shemesh wrote:
I've had a similar problem. X uses the current locale in order to convert the keycode into a character. Try setting you language type to Hungarian and then report. If you don't want to set the system locale, try the following command (under bash): LANG=hu wine ....... This will set the language for one application only.
It's not that easy :(
The problem is that XLookupString is used, which according to the Xlib documentation works only for Latin1 chars. It does _not_ takes locale settings into account. It is explicitly stated in the docs that XLookupString is for the cases when you dont need locale handling. If you want to handle locales you have to use the input method framework (described in a separate Xlib chapter). And I could not find a simple solution from those docs (tough this was the first case I have looked in the X's postscript documentation).
Nevertheless I have tried it with: LANG=hu wine WINWORD.EXE but the output is exactly the same.
So you can take it as I'm reporting it :)
Regards Zsolt
Rizsanyi Zsolt wrote:
On Wednesday 09 October 2002 14:25, Rizsanyi Zsolt wrote:
Hi!
When running MS Word 97 I get the next error messages when I try to write some of the Hungarian characters. So I'm reporting it as requested in the message :)
err:keyboard:X11DRV_ToUnicode Please report: no char for keysym 01F5 (odoubleacute) : err:keyboard:X11DRV_ToUnicode (virtKey=DB,scanCode=1A,keycode=22,state=10) err:keyboard:X11DRV_ToUnicode Please report: no char for keysym 01FB (udoubleacute) : err:keyboard:X11DRV_ToUnicode (virtKey=DC,scanCode=2B,keycode=33,state=10)
Is it trivial to fix, or there are some problems with it? I would like if that could work... I'm also willing to code it if that is needed :)
I have investigated it, and the problem is in this code (from dlls/x11drv/keyboard.c):
else TRACE("Found keycode %d (0x%2X)\n",e.keycode,e.keycode);
ret = XLookupString(&e, (LPVOID)lpChar, 2, &keysym, NULL); wine_tsx11_unlock();
if (ret == 0) · { · BYTE dead_char;
· dead_char = KEYBOARD_MapDeadKeysym(keysym); · if (dead_char) · { · MultiByteToWideChar(main_key_tab[kbd_layout].layout_cp, 0, &dead_char, 1, bufW, bufW_siz e); · ret = -1; · } · else · { · char· *ksname;
· ksname = TSXKeysymToString(keysym); · if (!ksname) · · ksname = "No Name"; · if ((keysym >> 8) != 0xff) · · { · · ERR("Please report: no char for keysym %04lX (%s) :\n", keysym, ksname); · · ERR("(virtKey=%X,scanCode=%X,keycode=%X,state=%X)\n", virtKey, scanCode, e.keycode, e.state); · · } · } · }
The problems come from that the XLookupString is used to convert the keycode to the display string. It does properly display that the pressed key is odoubleacute, but because XLookupString works only for Latin1 characters, so the string representation is not returned.
I dont see how this situation should be handled. Maybe another X function should be used instead of XLookupString (one which works with chars other than Latin1).
I'm not too good in X programming so please HELP!!
Thanks Zsolt
Hi!
I have read much about Xlib and Xkb extension, till I have found the next comment: /* tell the libX11 that we will do input method handling ourselves * that keep libX11 from doing anything whith dead keys, allowing Wine * to have total control over dead keys, that is this line allows * them to work in Wine, even whith a libX11 including the dead key * patches from Th.Quinot (http://Web.FdN.FR/~tquinot/dead-keys.en.html) */ TSXOpenIM( display, NULL, NULL, NULL);
So I have realized, that the keysym conversion should be done manually. So I have replaced the error reporting with manual conversion.
I have looked at 'X11/keysymdef.h' to determine the meaning of the third byte (0xff00) of the KeySym, and built a confversion map to a windows codepage.
If a codepage is found, then it is used in a MultiByteToWideChar to convert the last byte of KeySym.
And it works. Tested with Hungarian, Serbian (cirillic) and Croatian (latinic - else same as serbian) keyboards, and it works perfectly. But it should work with all of them...
So please apply.
ChangeLog: Fixed KEYBOARD_ToUnicode to work with non Latin1 chars.
On Saturday 12 October 2002 22:34, Rizsanyi Zsolt wrote:
The problem is that XLookupString is used, which according to the Xlib documentation works only for Latin1 chars. It does _not_ takes locale settings into account. It is explicitly stated in the docs that XLookupString is for the cases when you dont need locale handling. If you want to handle locales you have to use the input method framework (described in a separate Xlib chapter). And I could not find a simple solution from those docs (tough this was the first case I have looked in the X's postscript documentation).
Regards Zsolt
Rizsanyi Zsolt wrote:
On Wednesday 09 October 2002 14:25, Rizsanyi Zsolt wrote:
Hi!
When running MS Word 97 I get the next error messages when I try to write some of the Hungarian characters. So I'm reporting it as requested in the message :)
err:keyboard:X11DRV_ToUnicode Please report: no char for keysym 01F5 (odoubleacute) : err:keyboard:X11DRV_ToUnicode (virtKey=DB,scanCode=1A,keycode=22,state=10) err:keyboard:X11DRV_ToUnicode Please report: no char for keysym 01FB (udoubleacute) : err:keyboard:X11DRV_ToUnicode (virtKey=DC,scanCode=2B,keycode=33,state=10)
Is it trivial to fix, or there are some problems with it? I would like if that could work... I'm also willing to code it if that is needed :)
I have investigated it, and the problem is in this code (from dlls/x11drv/keyboard.c):
else TRACE("Found keycode %d (0x%2X)\n",e.keycode,e.keycode);
ret = XLookupString(&e, (LPVOID)lpChar, 2, &keysym, NULL); wine_tsx11_unlock();
if (ret == 0) · { · BYTE dead_char;
· dead_char = KEYBOARD_MapDeadKeysym(keysym); · if (dead_char) · { · MultiByteToWideChar(main_key_tab[kbd_layout].layout_cp, 0, &dead_char, 1, bufW, bufW_siz e); · ret = -1; · } · else · { · char· *ksname;
· ksname = TSXKeysymToString(keysym); · if (!ksname) · · ksname = "No Name"; · if ((keysym >> 8) != 0xff) · · { · · ERR("Please report: no char for keysym %04lX (%s) :\n", keysym, ksname); · · ERR("(virtKey=%X,scanCode=%X,keycode=%X,state=%X)\n", virtKey, scanCode, e.keycode, e.state); · · } · } · }
The problems come from that the XLookupString is used to convert the keycode to the display string. It does properly display that the pressed key is odoubleacute, but because XLookupString works only for Latin1 characters, so the string representation is not returned.
I dont see how this situation should be handled. Maybe another X function should be used instead of XLookupString (one which works with chars other than Latin1).
I'm not too good in X programming so please HELP!!
Thanks Zsolt
"Rizsanyi Zsolt" rizsanyi@myrealbox.com wrote:
I have looked at 'X11/keysymdef.h' to determine the meaning of the third byte (0xff00) of the KeySym, and built a confversion map to a windows codepage.
If a codepage is found, then it is used in a MultiByteToWideChar to convert the last byte of KeySym.
And it works. Tested with Hungarian, Serbian (cirillic) and Croatian (latinic - else same as serbian) keyboards, and it works perfectly. But it should work with all of them...
Even if it works for you, it's not the right fix. Hopefully support for dead keys and correct translation of X key events will be merged from CX Office CVS soon...
On Tuesday 15 October 2002 02:04, Dmitry Timoshkov wrote:
"Rizsanyi Zsolt" rizsanyi@myrealbox.com wrote:
I have looked at 'X11/keysymdef.h' to determine the meaning of the third byte (0xff00) of the KeySym, and built a confversion map to a windows codepage.
If a codepage is found, then it is used in a MultiByteToWideChar to convert the last byte of KeySym.
And it works. Tested with Hungarian, Serbian (cirillic) and Croatian (latinic - else same as serbian) keyboards, and it works perfectly. But it should work with all of them...
Even if it works for you, it's not the right fix. Hopefully support for dead keys and correct translation of X key events will be merged from CX Office CVS soon...
It's nice to hear. It would even be nicer if I could here about that earier (like before I started to hack on this issue).
Besides when will be that 'soon'?
Regards Zsolt
"Rizsanyi Zsolt" rizsanyi@myrealbox.com wrote:
Even if it works for you, it's not the right fix. Hopefully support for dead keys and correct translation of X key events will be merged from CX Office CVS soon...
It's nice to hear. It would even be nicer if I could here about that earier (like before I started to hack on this issue).
Besides when will be that 'soon'?
Probably when Alexandre will be doing next round of merges.
Rizsanyi Zsolt rizsanyi@myrealbox.com writes:
It's nice to hear. It would even be nicer if I could here about that earier (like before I started to hack on this issue).
Besides when will be that 'soon'?
As soon as possible, but that code depends on portions of the window focus management that I'm busy rewriting right now, so it will take a little time.
On Tuesday 15 October 2002 17:35, Alexandre Julliard wrote:
Rizsanyi Zsolt rizsanyi@myrealbox.com writes:
It's nice to hear. It would even be nicer if I could here about that earier (like before I started to hack on this issue).
Besides when will be that 'soon'?
As soon as possible, but that code depends on portions of the window focus management that I'm busy rewriting right now, so it will take a little time.
Ok. Thanks for the information.
Regards Zsolt
Does that mean that we'll have a mechanism for changing the X keyboard layout as a result from window focus changes?
This would come in very handy in case of edit control. There is a proposed standard (as well as the Windows behaviour) that dictates where and when cursor actions should change the input keyboard layout. That requires a mechanism that, to the best of my knowledge, doesn't exist there today.
Shachar
p.s. proposed standard can be found at http://imagic.weizmann.ac.il/~dov/Hebrew/logicUI24.htm I would apretiate feedback, as it is not accepted yet.
Sh.
Alexandre Julliard wrote:
Rizsanyi Zsolt rizsanyi@myrealbox.com writes:
It's nice to hear. It would even be nicer if I could here about that earier (like before I started to hack on this issue).
Besides when will be that 'soon'?
As soon as possible, but that code depends on portions of the window focus management that I'm busy rewriting right now, so it will take a little time.