Keyboard remapping (xmodmap) does not work in Warcraft III.

Open forum for end-user questions about Wine. Before asking questions, check out the Wiki as a first step.
Forum Rules
Locked
samyazza
Newbie
Newbie
Posts: 1
Joined: Sat Nov 07, 2009 9:40 am

Keyboard remapping (xmodmap) does not work in Warcraft III.

Post by samyazza »

I want to run my Warcraft III with better inventory shortcuts. I'm on a laptop and I do not have a numpad, I have an Fn key I can use to access the numbers (actually hiding under Fn+Shift+key since Ubuntu 8.10) . This combination does nothing in Warcraft though, as if it wasn't getting any hint of my keyboard action. Pressing only FN+key does things though, like lower the vision angle and such, just as expected. To work this around and make things more comfortable for my playing I've written a small script to remap the numerical keys to other keys, using xev to retrieve their keycodes. The script looks like this:

Code: Select all

xmodmap -e "keycode 10 = KP_7"
xmodmap -e "keycode 11 = KP_8"
xmodmap -e "keycode 12 = KP_4"
xmodmap -e "keycode 13 = KP_5"
xmodmap -e "keycode 14 = KP_1"
xmodmap -e "keycode 15 = KP_2"

wine 'Frozen Throne.exe' -opengl

xmodmap -e "keycode 10 = 1"
xmodmap -e "keycode 11 = 2"
xmodmap -e "keycode 12 = 3"
xmodmap -e "keycode 13 = 4"
xmodmap -e "keycode 14 = 5"
xmodmap -e "keycode 15 = 6"
Here's a sample xev output of pressing FN+shift+i:

Code: Select all

KeyPress event, serial 31, synthetic NO, window 0x3c00001,
    root 0x13b, subw 0x0, time 9969781, (722,546), root:(726,571),
    state 0x2000, keycode 50 (keysym 0xffe1, Shift_L), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyPress event, serial 34, synthetic NO, window 0x3c00001,
    root 0x13b, subw 0x0, time 9969977, (722,546), root:(726,571),
    state 0x2001, keycode 84 (keysym 0xffb5, KP_5), same_screen YES,
    XLookupString gives 1 bytes: (35) "5"
    XmbLookupString gives 1 bytes: (35) "5"
    XFilterEvent returns: False

KeyRelease event, serial 34, synthetic NO, window 0x3c00001,
    root 0x13b, subw 0x0, time 9970055, (722,546), root:(726,571),
    state 0x2001, keycode 84 (keysym 0xffb5, KP_5), same_screen YES,
    XLookupString gives 1 bytes: (35) "5"
    XFilterEvent returns: False

KeyRelease event, serial 34, synthetic NO, window 0x3c00001,
    root 0x13b, subw 0x0, time 9970178, (722,546), root:(726,571),
    state 0x2001, keycode 50 (keysym 0xffe1, Shift_L), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False
Running Warcraft with this script doesn't change anything though, pressing the keys 1-6 has no effect and I see the following on the console:

Code: Select all

err:ole:CoCreateInstance apartment not initialised
fixme:advapi:SetSecurityInfo stub
fixme:win:EnumDisplayDevicesW ((null),0,0x33f270,0x00000000), stub!
fixme:win:EnumDisplayDevicesW ((null),0,0x33f608,0x00000000), stub!
fixme:win:EnumDisplayDevicesW ((null),0,0x33f640,0x00000000), stub!
fixme:dsalsa:IDsDriverBufferImpl_SetVolumePan (0x15e3c8,0x1625c8): stub
fixme:keyboard:X11DRV_ActivateKeyboardLayout 0x4150415, 0000: semi-stub!
fixme:keyboard:X11DRV_ActivateKeyboardLayout 0x4150415, 0000: semi-stub!
fixme:keyboard:X11DRV_ActivateKeyboardLayout 0x4150415, 0000: semi-stub!
fixme:keyboard:X11DRV_ActivateKeyboardLayout 0x4150415, 0000: semi-stub!
fixme:keyboard:X11DRV_ActivateKeyboardLayout 0x4150415, 0000: semi-stub!
fixme:keyboard:X11DRV_ActivateKeyboardLayout 0x4150415, 0000: semi-stub!
The keyboard fixmes appear when I launch a new game. I'm confused with what is going on.

OS: Ubuntu 8.10
Wine version: wine-1.1.32

I know there's a bug with the whole keyboard controlled mouse cursor thingy. I have that turned off, just as it should be, so it's not the issue.

Please help me remap the numpad keys to 1-6 and make wine understand the remapping.
James McKenzie

Keyboard remapping (xmodmap) does not work in Warcraft III.

Post by James McKenzie »

samyazza wrote:
I want to run my Warcraft III with better inventory shortcuts. I'm on a laptop and I do not have a numpad, I have an Fn key I can use to access the numbers (actually hiding under Fn+Shift+key since Ubuntu 8.10) . This combination does nothing in Warcraft though, as if it wasn't getting any hint of my keyboard action. Pressing only FN+key does things though, like lower the vision angle and such, just as expected. To work this around and make things more comfortable for my playing I've written a small script to remap the numerical keys to other keys, using xev to retrieve their keycodes. The script looks like this:

[Much code removed to shorten my reply. It is relevant to a bug report.]
Please help me remap the numpad keys to 1-6 and make wine understand the remapping.

Please help us help you by filing a bug report with all of this
wonderful information. A developer may pick the report up and fix this,
permanently for you.

James McKenzie
Gert van den Berg

Keyboard remapping (xmodmap) does not work in Warcraft III.

Post by Gert van den Berg »

On Sat, Nov 7, 2009 at 17:03, samyazza <[email protected]> wrote:
I want to run my Warcraft III with better inventory shortcuts. I'm on a laptop and I do not have a numpad, I have an Fn key I can use to access the numbers (actually hiding under Fn+Shift+key since Ubuntu 8.10) . This combination does nothing in Warcraft though, as if it wasn't getting any hint of my keyboard action. Pressing only FN+key does things though, like lower the vision angle and such, just as expected. To work this around and make things more comfortable for my playing I've written a small script to remap the numerical keys to other keys, using xev to retrieve their keycodes. The script looks like this:
Workaround: Warcraft supports its own key remapping, customkeys.txt.

http://warkeys.sourceforge.net/ is a utility to generate a
custmkeys.txt for you.

Gert
Locked