RGamma Dec 7, 2012 @ 1:09pm
Issue Report: TF2, SS3:BFE, Trine 2 do not handle my custom Xmodmap (keyboard map) properly
Introduction
I have been using the Steelseries Zboard Merc[steelseries.com] for quite some time (approx. 4 years) now
and do not want to miss its 'ergonomic part' on the left anymore. Because there are no Linux drivers available and the gaming keys (i.e. irregular keys) are not mapped automatically, I had to write my own map (the so called Xmodmap).

Explanation (devs most likely want to skip this part)
When you press a key a 'keypress event' is generated, which can be assigned to a certain symbol (e.g. a letter). 'Keypress events' have a numeric identifier (keycode); one can read them with 'xev':
Example output for the physical key 'w':
KeyPress event, serial 39, synthetic NO, window 0x4000001,
root 0x26e, subw 0x0, time 6595556, (61,-13), root:(1688,268),
state 0x0, keycode 25 (keysym 0x77, w), same_screen YES,
XLookupString gives 1 bytes: (77) "w"
XmbLookupString gives 1 bytes: (77) "w"
XFilterEvent returns: False

KeyRelease event, serial 39, synthetic NO, window 0x4000001,
root 0x26e, subw 0x0, time 6595644, (61,-13), root:(1688,268),
state 0x0, keycode 25 (keysym 0x77, w), same_screen YES,
XLookupString gives 1 bytes: (77) "w"
XFilterEvent returns: False
Keycodes bind to symbols (or the other way round? ;)). As there are several keys and symbols a file called Xmodmap is needed to organize their various bindings in form of a list (i.e. the map). The corresponding (automatically generated) line to the example above is:
keycode 25 = w W w W lstroke Lstroke lstroke
So if one wants the unmapped keys to work, he has to bind the keycodes of the unmapped keys to the corresponding symbols of the 'regular' keys:
KeyPress event, serial 37, synthetic NO, window 0x3c00001,
root 0x26e, subw 0x0, time 7725221, (573,-38), root:(1444,422),
state 0x0, keycode 180 (keysym 0x77, w), same_screen YES,
XKeysymToKeycode returns keycode: 25
XLookupString gives 1 bytes: (77) "w"
XmbLookupString gives 1 bytes: (77) "w"
XFilterEvent returns: False

KeyRelease event, serial 38, synthetic NO, window 0x3c00001,
root 0x26e, subw 0x0, time 7725309, (573,-38), root:(1444,422),
state 0x0, keycode 180 (keysym 0x77, w), same_screen YES,
XKeysymToKeycode returns keycode: 25
XLookupString gives 1 bytes: (77) "w"
XFilterEvent returns: False
Xmodmap entry:
keycode 180 = w W

Bug description
In Team Fortress 2 for Linux the binding of a not automatically mapped key to a regular key (e.g. 180->25) does not work properly. These 'irregular' keys and the symbols they represent according to the Xmodmap seem to be interpreted somewhat randomly resulting in the wrong action being triggered when such a key (e.g. keycode 180) is pressed.
I found that if I open the options menu ingame and assign the action 'Walk forward' to the key with keycode 180 (which should bind to 'w') 'j' (keycode 44) is displayed instead. Some other examples ('gaming key symbol'(keycode) -> 'regular key symbol'(keycode):
  • 1(87)->KP_END(10)
  • a(166)->k(45)
  • TAB(148)->g(42)
Strangely enough some gaming keys do not even get recognized (like 'v', 'b' or 'p') and some of them have the correct mapping (like (left) 'Ctrl' or (left) 'Shift'). My full Xmodmap is available here: http://pastebin.com/XTiG9ZQ0
In Killing Floor for Linux or Team Fortress 2 on Windows or Wine these problems do not occur.
I know that it is probably not possible/very hard for you to reproduce this issue without my type of keyboard, but I hope you're at least having a look at it, as this may affect others too. (Playing with normal keys works as expected, so bug priority is rather low.)

System information according to Steam:
Processor Information:
Vendor: GenuineIntel
Speed: 2667 Mhz
4 logical processors
4 physical processors
HyperThreading: Unsupported
FCMOV: Supported
SSE2: Supported
SSE3: Supported
SSSE3: Supported
SSE4a: Unsupported
SSE41: Supported
SSE42: Supported

Network Information:
Network Speed:

Operating System Version:
Linux (64 bit)
Kernel Name: Linux
Kernel Version: 3.6.9-1-ARCH
X Server vendor: The X.Org Foundation
X Server release: 11300000

Video Card:
Driver: NVIDIA Corporation GeForce GTX 260/PCIe/SSE2

Driver Version: 3.3.0 NVIDIA 310.19
Desktop Color Depth: 24 bits per pixel
Monitor Refresh Rate: 60 Hz
VendorID: 0x10de
DeviceID: 0x5e2
Number of Monitors: 1
Number of Logical Video Cards: 1
Primary Display Resolution: 1920 x 1080
Desktop Resolution: 1920 x 1080
Primary Display Size: 20,91" x 11,77" (23,98" diag)
53,1cm x 29,9cm (60,9cm diag)
Primary Bus: PCI Express 16x
Primary VRAM: 896 MB
Supported MSAA Modes: 2x 4x 8x 16x

Sound card:
Audio device: AV200

Memory:
RAM: 7986 Mb

Miscellaneous:
UI Language: English
LANG: de_DE.UTF-8
Microphone: Not set
Total Hard Disk Space Available: 522488 Mb
Largest Free Hard Disk Block: 389016 Mb

Installed software:

Recent Failure Reports:
Fri Dec 7 17:00:38 2012 GMT: file ''/tmp/dumps/assert_20121207180033_1.dmp'', upload yes: ''CrashID=bp-677da440-8089-4925-a7a0-df2712121207''
Fri Dec 7 17:32:28 2012 GMT: file ''/tmp/dumps/crash_20121207183223_1.dmp'', upload yes: ''CrashID=bp-9a9fa55e-f684-44bd-96be-827242121207''
If you need further examples/information please let me know. Thank you for reading.

Edit: Reopened thread in appropriate sub-forum.

Edit 2: After some more testing it seems that Serious Sam 3: BFE and Trine 2 have this bug also. Changed title accordingly.
Last edited by RGamma; Dec 8, 2012 @ 6:32am
Showing 1-3 of 3 comments
< >
Karlodinium Apr 13, 2013 @ 5:07am 
I can confirm this bug in Kubuntu 12.10, and add a bit more information in TF2. The remapped keys do work properly in some situations, e.g. the console. However, they cannot be mapped to actions properly. e.g. I've remapped the character "2' to the key "1" with xmodmap. If I press the "1" key when setting an action, "1" is displayed (incorrectly). Then, in game, I need to press the key that really produces the "1" character.

In addition, some other (non-remapped) keys are not recognised at all, so I suspect the xmodmap bug is just part of a larger problem. I cannot get Enter recognised in any situation.

xev output:
KeyPress event, serial 42, synthetic NO, window 0x8800001,
root 0xcd, subw 0x0, time 95369424, (167,-10), root:(169,853),
state 0x0, keycode 255 (keysym 0xff0d, Return), same_screen YES,
" XLookupString gives 1 bytes: (0d) "
" XmbLookupString gives 1 bytes: (0d) "
XFilterEvent returns: False

If it's important, I'm using a "Truly Ergonomic Keyboard".
Pocket Apr 14, 2013 @ 5:02pm 
Interesting. I happen to have one of the older Mercs from before Zboard was bought out by Steelseries (I guess, since that's the only brand on the box), and I noticed that the gaming keys don't default to being duplicates of the keys they're based on in Linux. (In fact, a few of them are bound to completely random keys and key combinations. Shift is slash, E opens Rekonq, etc. And most don't do anything.) Thankfully the numpad still works correctly. Thanks for letting me know how I'm supposed to fix it... and that I shouldn't bother because it doesn't work.
Karlodinium Apr 25, 2013 @ 5:12pm 
Even worse, when I'm attempting to chat in Steam, it now misinterprets my Enter key and opens up big picture, which takes about 10 seconds to load every time.
Showing 1-3 of 3 comments
< >
Per page: 15 30 50