Changes between Version 10 and Version 16 of Ticket #2043


Ignore:
Timestamp:
Jul 30, 2013, 11:09:35 AM (11 years ago)
Author:
lsdh
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #2043 – Description

    v10 v16  
    1 On Linux (tested on Ubuntu 13.4 with gnome shell); the hotkeys ctrl+1 to ctrl+0 did not work natively in my case (but does in Windows 7, same computer). I have a Belgian keyboard, so default keymapping is really different from the US one.
     1On Linux (tested on Ubuntu 13.4 with gnome shell); the hotkeys ctrl+1 to ctrl+0 did not work natively in my case (but does in Windows 7, same computer, same keyboard layout). I have a Belgian keyboard, so default keymapping is really different from the US one.
    22
    33A ~/.config/0ad/config/local.cfg can receive modifications to have custom hotkeys, but some keys I needed where not available: § à ç è é
    44
    5 Theses keys are also present in the French keyboards (the only change for theses places is at place 6: "-" instead of "§").
     5Theses keys are (in sdl 1.2) part of the SDLK_WORLD keys.
    66
    7 To have a full ctrl+1 to ctrl+0 bar, I added theses entries in the /0ad/source/ps/Keyname.cpp list :
     7Unfortunately, the numbers used are not always the same (at least different in OSX with french keyboard).
     8
     9To allow people to have a full ctrl+1 to ctrl+0 bar without changing the sources and to anticipate the possible keypapping in the GUI, I added the full SDLK_WORLD key list in the /0ad/source/ps/Keyname.cpp list.
     10
     11As the SDLK_WORLD are no more there in sdl2, I putted the definition there:
    812
    913{{{
    10         { SDLK_WORLD_7, "Sect", 0 },
    11         { SDLK_WORLD_64, "Agrave", 0 },
    12         { SDLK_WORLD_71, "Ccedil", 0 },
    13         { SDLK_WORLD_72, "Egrave", 0 },
    14         { SDLK_WORLD_73, "Eacute", 0 },
     14#if SDL_VERSION_ATLEAST(2, 0, 0)
     15        { SDLK_KP_0, "Numpad 0", "Num0" },
     16        .
     17        .
     18        .
     19        { SDLK_KP_9, "Numpad 9", "Num9" },
     20#else
     21        == { SDLK_WORLD_0, "World0", "W0" },
     22        .
     23        .
     24        .
     25        { SDLK_WORLD_95, "World95", "W95" }, ==
     26
     27
     28        { SDLK_KP0, "Numpad 0", "Num0" },
     29        .
     30        .
     31        .
     32        { SDLK_KP9, "Numpad 9", "Num9" },
     33#endif
    1534}}}
    1635And configured the ~/.config/0ad/config/local.cfg like this:
    1736
    1837{{{
    19 hotkey.selection.group.select.0 = Agrave
    20 hotkey.selection.group.save.0 = "Ctrl+Agrave"
    21 hotkey.selection.group.add.0 = "Shift+Agrave"
     38hotkey.selection.group.select.0 = W64
     39hotkey.selection.group.save.0 = "Ctrl+W64"
     40hotkey.selection.group.add.0 = "Shift+W64"
    2241hotkey.selection.group.select.1 = Ampersand
    2342hotkey.selection.group.save.1 = "Ctrl+Ampersand"
    2443hotkey.selection.group.add.1 = "Shift+Ampersand"
    25 hotkey.selection.group.select.2 = Eacute
    26 hotkey.selection.group.save.2 = "Ctrl+Eacute"
    27 hotkey.selection.group.add.2 = "Shift+Eacute"
     44hotkey.selection.group.select.2 = W73
     45hotkey.selection.group.save.2 = "Ctrl+W73"
     46hotkey.selection.group.add.2 = "Shift+W73"
    2847hotkey.selection.group.select.3 = DoubleQuote
    2948hotkey.selection.group.save.3 = "Ctrl+DoubleQuote"
     
    3554hotkey.selection.group.save.5 = "Ctrl+LeftParen"
    3655hotkey.selection.group.add.5 = "Shift+LeftParen"
    37 hotkey.selection.group.select.6 = Sect
    38 hotkey.selection.group.save.6 = "Ctrl+Sect"
    39 hotkey.selection.group.add.6 = "Shift+Sect"
    40 hotkey.selection.group.select.7 = Egrave
    41 hotkey.selection.group.save.7 = "Ctrl+Egrave"
    42 hotkey.selection.group.add.7 = "Shift+Egrave"
     56hotkey.selection.group.select.6 = W7
     57hotkey.selection.group.save.6 = "Ctrl+W7"
     58hotkey.selection.group.add.6 = "Shift+W7"
     59hotkey.selection.group.select.7 = W72
     60hotkey.selection.group.save.7 = "Ctrl+W72"
     61hotkey.selection.group.add.7 = "Shift+W72"
    4362hotkey.selection.group.select.8 = Exclaim
    4463hotkey.selection.group.save.8 = "Ctrl+Exclaim"
    4564hotkey.selection.group.add.8 = "Shift+Exclaim"
    46 hotkey.selection.group.select.9 = Ccedil
    47 hotkey.selection.group.save.9 = "Ctrl+Ccedil"
    48 hotkey.selection.group.add.9 = "Shift+Ccedil"
     65hotkey.selection.group.select.9 = W71
     66hotkey.selection.group.save.9 = "Ctrl+W71"
     67hotkey.selection.group.add.9 = "Shift+W71"
    4968}}}
    50 The /0ad/binaries/data/config/keys.txt should also be updated.
     69The /0ad/binaries/data/config/keys.txt should also be updated to warn theses keys are available.
    5170
    5271I could manage to do this changes thanks to Philip` and RedFox| on the IRC, so a big thanks to them.
     
    5675
    5776
    58 ''(to add other keys, you can temporary add the line''
     77''(To know which SDLK_WORLD number correspond to a keys, you can temporary add the line''
    5978
    6079{{{
     
    6281}}}
    6382
    64 ''in the HotkeyInputHandler function of /0ad/source/ps/Hotkey.cpp then compile and lauch the game in a terminal. an integer will be displayed when the key is pressed:''
     83''in the HotkeyInputHandler function of /0ad/source/ps/Hotkey.cpp then compile and launch the game in a terminal. An integer will be displayed when a key is pressed:''
    6584
    6685{{{