ControlsRework.wiki
changeset 1856 2d2693ace6fe
parent 1855 699f4981643d
child 1859 695f35df799e
equal deleted inserted replaced
1855:699f4981643d 1856:2d2693ace6fe
    23  # Yes.
    23  # Yes.
    24 
    24 
    25 Summary: The problem with our current approach is point 1. The frontend displays the wrong key. The fact that the game inconsistently uses keycodes AND scancodes is also a little insane. Any solution definitely must fix point 1, otherwise it gains us nothing
    25 Summary: The problem with our current approach is point 1. The frontend displays the wrong key. The fact that the game inconsistently uses keycodes AND scancodes is also a little insane. Any solution definitely must fix point 1, otherwise it gains us nothing
    26 
    26 
    27 === B) Use scancodes in frontend, engine und config. Create a small helper program that queries scancode in frontend to replace the drop-down menu ===
    27 === B) Use scancodes in frontend, engine und config. Create a small helper program that queries scancode in frontend to replace the drop-down menu ===
       
    28 
       
    29 How it's supposed to work:
       
    30  # Write SDL window for getting the key. It must give scancode as return/exit code
       
    31  # Frontend: Replace drop-down with widget that opens the SDL window and detect the exit code
       
    32  # Save scancode in config file
       
    33  # Frontend: Figure out how to turn the scancode into human-readable text
       
    34 
       
    35 Criteria:
       
    36 
    28  # Yes.
    37  # Yes.
    29  # No obvious solution in sight. Maybe there is one?
    38  # No obvious solution in sight. Maybe there is one?
    30    * Possible, hacky solution: Convert scancode to keycode using a hardcoded lookup table or something like that
    39    * Possible, hacky solution: Convert scancode to keycode using a hardcoded lookup table or something like that
    31    * https://github.com/hluk/qxtglobalshortcut/blob/16446200b699e0610b8a5fb20b74938225d81d87/src/xcbkeyboard.h#L249
    40    * https://github.com/hluk/qxtglobalshortcut/blob/16446200b699e0610b8a5fb20b74938225d81d87/src/xcbkeyboard.h#L249
    32  # Yes. Convert scancode to keycode with SDL_GetKeyFromScancode
    41  # Yes. Convert scancode to keycode with SDL_GetKeyFromScancode