http://bugs.winehq.org/show_bug.cgi?id=11122
Summary: xf86-input-keyboard trouble with (probably) direct input Product: Wine Version: 0.9.52. Platform: PC OS/Version: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: directx-dinput AssignedTo: wine-bugs@winehq.org ReportedBy: liquid.acid@gmx.net
Hi there,
I just noticed that keyboard input in Half-Life doesn't seem to work for me. I'm currently using wine version 0.9.52, but already tried to downgrade to 0.9.51, 0.9.50 and 0.9.49. That does not fix the problem. But I knew that 0.9.49 wasn't giving me this problem when previously playing Half-Life on this system. So the problem had to be somewhere else. Because it was keyboard related and I updated the xorg-server recently, also updating xf86-input-keyboard I suspect this to be the keyboard driver.
What exactly is the problem? I have a german keyboard (QWERTZ layout) and the last keyboard row above the row where the space key is, is giving me problem.
On this row are the keys ...,Y,X,C,V,B,N,M,...
Now these keys work fine when working on the console and in Xfce. When using Half-Life the keys seem to be somehow remapped. Pressing Y outputs a X, pressing X gives me a C, C -> V, etc.
This does only apply to this special row of the keyboard. My friend who was using wine-0.9.52 the day I first experienced this does not have this kind of problems. He was using xf86-input-keyboard-1.1.1 this day. I have another desktop machine which also has version 1.1.1 of the keyboard driver installed and also does not show the problem.
My friend currently updates the keyboard driver to 1.2.2 (the version I'm using) to reproduce the problem.
A few further informations. My current XkbLayout is "de", there the problem appears. When changing the layout to "en" the problem is gone, no remapping occurs there.
This problem does not appear when using some standard win32 gui applications, so I suspect this to related to direct input (AFAIK Half-Life uses this).
I'm also going to file a report on the gentoo bugzilla, because of a possible input-keyboard regression.
Bye, Tobias
http://bugs.winehq.org/show_bug.cgi?id=11122
Vitaliy Margolen vitaliy@kievinfo.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Component|directx-dinput |x11-driver Summary|xf86-input-keyboard trouble |xf86-input-keyboard trouble |with (probably) direct input|
--- Comment #1 from Vitaliy Margolen vitaliy@kievinfo.com 2008-01-10 13:32:15 --- Wrong, Half-life never used dinput. Don't claim what you do not know.
Sounds like you have wrong mapping of keys to scan-codes/v-keys in Wine (x11drv).
http://bugs.winehq.org/show_bug.cgi?id=11122
--- Comment #2 from Tobias Jakobi liquid.acid@gmx.net 2008-01-10 14:35:43 --- You're right. Testing this with UT revealed that both non-dinput and dinput mode work and produce the correct characters.
To the scancode mapping problem: I wouldn't even know how to change it. The point is that it works with 1.1.1 but not with 1.2.2 (my friend finished upgrading his Xorg keyb driver to 1.2.2 and is now experiencing the same problem).
So either it's a bug in wine (that didn't appear until now), a regression in xf86-input-keyboard, or a compatibility issue with both applications.
And I should correct the layout thing. What I changed the layout to is "us" ("en" doesn't even exist on my system). I currently use a setxkbmap hotfix to avoid the problem.
http://bugs.winehq.org/show_bug.cgi?id=11122
Jan Buecken jb.faq@gmx.de changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |jb.faq@gmx.de
--- Comment #3 from Jan Buecken jb.faq@gmx.de 2008-01-24 08:25:25 --- Hi there, I tested this with xf86-input-keyboard-1.2.2 xorg-server1.4.0.90-r2 mesa 7.0.2 libXrender 0.9.4 pixman 0.9.6 xtrans1.0.4 wine 0.9.53 I listed all this because I using Gentoo and you have to update all this when you want to use xf86-input-driver 1.2.2 (xorg-server update from 1.3.0.0-r4 to the one above is required)
My new experience: I tried this with the following options in my xorg.conf: With Option XkbLayout "de" and Option XkbVariant "nodeadkeys" I can confirm the problem. With Option XkbLayout "us" (and no Option "nodeadkeys") I can confirm what Tobias said, there is no problem. But the following is very interessting, maybe: With XkbLayout "de" and NO Option XkbVariant "nodeadkeys" there is NO problem too!!! Why?
Bye Jan
http://bugs.winehq.org/show_bug.cgi?id=11122
Jan Buecken jb.faq@gmx.de changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Ever Confirmed|0 |1
--- Comment #4 from Jan Buecken jb.faq@gmx.de 2008-01-26 06:52:27 --- *** This bug has been confirmed by popular vote. ***
http://bugs.winehq.org/show_bug.cgi?id=11122
Tobias Jakobi liquid.acid@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |liquid.acid@gmx.net
--- Comment #5 from Tobias Jakobi liquid.acid@gmx.net 2008-02-10 19:10:26 --- Rechecked with wine version 0.9.55 and the bug is still there.
http://bugs.winehq.org/show_bug.cgi?id=11122
--- Comment #6 from Jan Buecken jb.faq@gmx.de 2008-02-18 07:37:39 --- Hi, I can confirm the bug with the game Blood2 (and wine 0.9.55)
http://bugs.winehq.org/show_bug.cgi?id=11122
--- Comment #7 from Tobias Jakobi liquid.acid@gmx.net 2008-02-20 08:21:18 --- I can verify what Jan said. I'm now applying the same hotfix as with the HL engine (switching the keyb layout to US prior to starting the game).
I'm going to try another DX6 game in the next few days (System Shock 2), maybe the problem also appears there.
http://bugs.winehq.org/show_bug.cgi?id=11122
--- Comment #8 from Jan Buecken jb.faq@gmx.de 2008-02-21 07:16:58 --- Hi, maybe this is interesting: I played the windows version of zsnes-1.42n with wine 0.9.55, because we want to test the network function. I can confirm that the bug affects the zsnes emulator too.
http://bugs.winehq.org/show_bug.cgi?id=11122
--- Comment #9 from Jan Buecken jb.faq@gmx.de 2008-03-24 07:03:48 --- reconfirming with wine 0.9.58 and xf86-input-keyboard-1.3.0
http://bugs.winehq.org/show_bug.cgi?id=11122
Tobias Jakobi liquid.acid@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- Summary|xf86-input-keyboard trouble |xkbd: non-US layout results | |in wrong key mapping
--- Comment #10 from Tobias Jakobi liquid.acid@gmx.net 2008-06-04 18:58:32 --- Hi there,
at first I wanna reconfirm the problem with wine-1.0_rc3
Then I wanted to point out that I upgraded xorg-server even further and removed xf86-input-keyboard completly. Keyboard is now accessed via evdev and the xf86-input-evdev driver infrastructure.
The bug is still there, when using my normal german keyb layout the mapping is wrong (means shifted) and everything is fine as soon as I switch to US layout.
Therefore I changed the description of the problem, because it doesn't seem to be directly related to xf86-input-keyboard, but more to the entire xkbd system.
I think more people will encounter this bug when switching to the new xserver that should arrive in the next weeks.
http://bugs.winehq.org/show_bug.cgi?id=11122
--- Comment #11 from Tobias Jakobi liquid.acid@gmx.net 2008-06-19 15:39:54 --- Reconfirming with wine-1.0
http://bugs.winehq.org/show_bug.cgi?id=11122
--- Comment #12 from el elton@schiert.net 2008-09-07 22:39:19 --- I had the same problem and found a workaround:
In /usr/share/X11/xkb/symbols/de in the section for the nodeadkeys layout I changed key <AE12> { [apostrophe, grave, cedilla, cedilla ] }; to key <AE12> { [acute, grave, cedilla, cedilla ] };
Now the bottom row is working the way it should.
http://bugs.winehq.org/show_bug.cgi?id=11122
--- Comment #13 from el elton@schiert.net 2008-09-08 15:34:49 --- Created an attachment (id=15935) --> (http://bugs.winehq.org/attachment.cgi?id=15935) alternative fix
This patch fixes the problem without any changes to X11 files. So, is this a Wine bug or a X.org bug?
http://bugs.winehq.org/show_bug.cgi?id=11122
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |patch
http://bugs.winehq.org/show_bug.cgi?id=11122
--- Comment #14 from Dmitry Timoshkov dmitry@codeweavers.com 2008-09-09 06:52:35 --- (In reply to comment #13)
This patch fixes the problem without any changes to X11 files. So, is this a Wine bug or a X.org bug?
This is a Wine bug, please send your patch to wine-patches.
http://bugs.winehq.org/show_bug.cgi?id=11122
--- Comment #15 from Tobias Jakobi liquid.acid@gmx.net 2008-09-21 12:48:14 --- (In reply to comment #14)
This is a Wine bug, please send your patch to wine-patches.
I don't think so. I'm going to attach a camshot from my laptop keyboard. That's a german keyboard layout.
The interesting part is the key left from the backspace key.
Pressing it should generate a "acute accent", that's: ´ Pressing it + SHIFT should generate a "grave accent", that's: `
Also notice the lower key, left of the ENTER key. Pressing it + SHIFT should generate a normal "apostrophe character", that's: '
Now, all of the above should happen, however in reality it's not fully working: Generating the "apostrophe character": works like expected Generating the "grave accent": works like expected Generating the "acute accent": DOESN'T work like expected, this simply generates another "apostrophe character".
To me it looks like wine has the correct layout table stored in keyboard.c, but X is wrong about it's layout. I'm going to ask this on IRC / mailing list.
Greets, Tobias
http://bugs.winehq.org/show_bug.cgi?id=11122
--- Comment #16 from Tobias Jakobi liquid.acid@gmx.net 2008-09-21 12:50:51 --- Created an attachment (id=16199) --> (http://bugs.winehq.org/attachment.cgi?id=16199) german keyboard on Dell Inspiron 1300
http://bugs.winehq.org/show_bug.cgi?id=11122
--- Comment #17 from Tobias Jakobi liquid.acid@gmx.net 2008-09-21 13:39:48 --- I was pointed to https://bugs.freedesktop.org/show_bug.cgi?id=11514 by someone from the #gentoo.de IRC channel.
I wrote a mail to the xorg ml, asking them if the change didn't make any sense at all. If they think that the current mapping is OK, then I wrap up el's patch for wine and send it. Until then...
http://bugs.winehq.org/show_bug.cgi?id=11122
volker.groeschel@sap.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |volker.groeschel@sap.com
--- Comment #18 from volker.groeschel@sap.com 2008-10-08 08:27:32 --- Any chance that the patch from Tobias: http://www.winehq.org/pipermail/wine-patches/2008-September/062176.html makes it into 1.1.6
http://bugs.winehq.org/show_bug.cgi?id=11122
--- Comment #19 from Tobias Jakobi liquid.acid@gmx.net 2008-10-08 09:41:23 --- Hi Volker,
I'll try a third resend this evening. If that doesn't work out I'm going to ask juillard about any obvious problems with the patch (however there shouldn't be any since it only adds additional keyboard layout tables and adds some comments about why this was done).
Greets, Tobias
http://bugs.winehq.org/show_bug.cgi?id=11122
--- Comment #20 from Dmitry Timoshkov dmitry@codeweavers.com 2008-10-08 09:59:03 --- It would be much better and simpler to just remove the offending character from the existing layout than add new almost not indistinguishable layouts.
http://bugs.winehq.org/show_bug.cgi?id=11122
--- Comment #21 from Tobias Jakobi liquid.acid@gmx.net 2008-10-08 10:22:51 --- @Dmitry: I don't think I understand you. What do you wanna remove exactly and where?
http://bugs.winehq.org/show_bug.cgi?id=11122
--- Comment #22 from Dmitry Timoshkov dmitry@codeweavers.com 2008-10-08 10:34:08 --- Avoid having that acute/apostrophe thing in the the Wine German keyboard layout.
http://bugs.winehq.org/show_bug.cgi?id=11122
--- Comment #23 from Tobias Jakobi liquid.acid@gmx.net 2008-10-08 10:55:08 --- OK, I think I know what you mean. I already tried that, left the array element blank so to speak (only a "" there). That didn't work for me - same offset problem like before.
This whole layout detecting thing seems to be highly unstable. This also explains why the detection fails if only one symbol is different (acute versus apostrophe).
http://bugs.winehq.org/show_bug.cgi?id=11122
--- Comment #24 from Dmitry Timoshkov dmitry@codeweavers.com 2008-10-08 11:08:35 --- (In reply to comment #23)
OK, I think I know what you mean. I already tried that, left the array element blank so to speak (only a "" there). That didn't work for me - same offset problem like before.
You shouldn't remove the key characters completely since, just omit the one that doesn't exist in all layouts.
This whole layout detecting thing seems to be highly unstable. This also explains why the detection fails if only one symbol is different (acute versus apostrophe).
Patches are welcome, use +key,+keyboard,+x11drv,+event to debug it. But certainly that's not a solution to pollute winex11.drv with seemingly same tables.
http://bugs.winehq.org/show_bug.cgi?id=11122
--- Comment #25 from Tobias Jakobi liquid.acid@gmx.net 2008-10-08 11:47:46 --- (In reply to comment #24)
You shouldn't remove the key characters completely since, just omit the one that doesn't exist in all layouts.
I wrote "element" (singular), of course I DIDN'T remove ALL entries from the tables. ;)
Patches are welcome, use +key,+keyboard,+x11drv,+event to debug it. But certainly that's not a solution to pollute winex11.drv with seemingly same tables.
"Pollution is the introduction of contaminants into an environment that causes instability, disorder, harm or discomfort to the physical systems or living organisms they are in." I don't think this patch does produce any of these effects. :)
But I'll take a look if more simplification is possible.
http://bugs.winehq.org/show_bug.cgi?id=11122
--- Comment #26 from Dmitry Timoshkov dmitry@codeweavers.com 2008-10-08 20:56:19 --- (In reply to comment #25)
(In reply to comment #24)
You shouldn't remove the key characters completely since, just omit the one that doesn't exist in all layouts.
I wrote "element" (singular), of course I DIDN'T remove ALL entries from the tables. ;)
I meant that if existing key in the layout table has "aA'" and that's "'" which causes the problems then just change the key to "aA" by omitting the offending "'".
http://bugs.winehq.org/show_bug.cgi?id=11122
--- Comment #27 from Tobias Jakobi liquid.acid@gmx.net 2008-10-09 13:19:20 --- Created an attachment (id=16556) --> (http://bugs.winehq.org/attachment.cgi?id=16556) new patch for the keyb offset problem
Hi Dmitry,
I think this is a cleaner version. I did what you proposed, well kind of. I replaced the offending acutes/apostrophes with NULL chars, so the detecting code skips them. That works good for me and should have such an high impact like removing the whole key where the offending char is generated from.
I also moved the Logitech layout to the other german layout and added my (modified) comment why this change was done (plus the link to the discussion on FDO).
Could you please take a look at let me know what you now think of it?
Thanks, Tobias
http://bugs.winehq.org/show_bug.cgi?id=11122
--- Comment #28 from Dmitry Timoshkov dmitry@codeweavers.com 2008-10-09 21:07:41 --- You shouldn't need to have a \0.
http://bugs.winehq.org/show_bug.cgi?id=11122
--- Comment #29 from Tobias Jakobi liquid.acid@gmx.net 2008-10-10 01:38:25 --- Huh? Then I don't think I have understood the detection code correctly.
Let's take for example main_key_DE_logitech. The problematic entry is "'`", since it depends on xkeyboard-config if the normal un-shifted keypress generates a apostrophe (') or an acute (´). So I replace "'`" with "\0`" so that the un-shifted value is not checked but only the shifted one (which should match since the mapping issue doesn't affect the accent grave).
If I shouldn't need a \0, what should I need then? I can't simply replace the entry with "`" because that would mean the unshifted symbol is a grave, which is ALWAYS wrong for a german keyboard layout. " `" would be also wrong, since the un-shifted keypress doesn't produce a space symbol.
Your method described in comment #26 can't be applied here. It only works if the offending symbol is the last one in the entry, so it can be simply removed.
Or am I missing something here???
http://bugs.winehq.org/show_bug.cgi?id=11122
--- Comment #30 from Dmitry Timoshkov dmitry@codeweavers.com 2008-10-10 02:06:29 --- (In reply to comment #29)
If I shouldn't need a \0, what should I need then? I can't simply replace the entry with "`" because that would mean the unshifted symbol is a grave, which is ALWAYS wrong for a german keyboard layout. " `" would be also wrong, since the un-shifted keypress doesn't produce a space symbol.
Have you actually tried that, or just think it won't work?
http://bugs.winehq.org/show_bug.cgi?id=11122
--- Comment #31 from Tobias Jakobi liquid.acid@gmx.net 2008-10-10 03:43:28 --- Yeah, that's what I implemented first. That was part of the code I mentioned in comment #23, the one that didn't really work for me. That was also before taking a deeper look at the detection code and how it actually works. If I understand the code correctly NULL-symbols are just skipped.
if ((*lkey)[key][i] && ((*lkey)[key][i] == ckey[keyc][i])) ok++; if ((*lkey)[key][i] && ((*lkey)[key][i] != ckey[keyc][i])) ok = -1;
That's a noop for NULL-symbols. Of course when putting a "" entry in the table that results in four NULL-symbols which are all skipped. But that's not what I want here, since I only want to remove the symbol that is "faulty".
http://bugs.winehq.org/show_bug.cgi?id=11122
--- Comment #32 from Dmitry Timoshkov dmitry@codeweavers.com 2008-10-10 04:00:11 --- Then your new patch is obviously correct, please send to wine-patches.
http://bugs.winehq.org/show_bug.cgi?id=11122
--- Comment #33 from Tobias Jakobi liquid.acid@gmx.net 2008-10-10 08:36:43 --- Thanks Dmitry, going to send it this evening.
http://bugs.winehq.org/show_bug.cgi?id=11122
Tobias Jakobi liquid.acid@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |FIXED
--- Comment #34 from Tobias Jakobi liquid.acid@gmx.net 2008-10-15 11:41:58 --- Patch is now in git master, resolving to FIXED.
http://bugs.winehq.org/show_bug.cgi?id=11122
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #35 from Alexandre Julliard julliard@winehq.org 2008-10-24 11:12:46 --- Closing bugs fixed in 1.1.7.