Skip to content

Remapping joystick axes through the registry #258

Open

Description

@steinuil

I'm trying to remap the axes of a Logitech Extreme 3D Pro controller for Hardwar (appid 1500540), which uses DirectInput and only supports binding the throttle to the Z axis (which is yaw on the joystick) or Slider1/2 (which are not mapped). The throttle that I'd like to use as Slider1 is mapped to Rx in joy.cpl

According to the Wine docs, you can add a SZ entry under HKCU\Software\Wine\DirectInput named after the joydev name of the device to remap the axes, in my case I added these entries (first is the joydev device name, the second is what you see through joy.cpl):

"Logitech Logitech Extreme 3D"="X,Y,Z,Slider1,POV1"
"Logitech Extreme 3D"="X,Y,Z,Slider1,POV1"

This doesn't work; when I run joy.cpl I still see the joystick throttle still bound to Rx and not Slider1.

Is this method of remapping joystick axes still supported? I went through the codebase searching for Software\\Wine\\DirectInput and found a couple hits but I couldn't figure out how it was being used or where this mapping is done.

The Wine wiki also mentions grepping the wine debug logs for joydev_enum_device, but that doesn't turn up. The joystick name only turns up in a hid_joystick_enum_device log.

I also found some references to Software\Wine\DirectInput\Joysticks and Software\Wine\DirectInput\Mapping\[username]\[device]\[guid], are these useful/documented anywhere?

Activity

  1. zmtong1988 commented on Oct 17, 2024

    @zmtong1988
    Contributor

    Possible need to close:
    Enable SDL 0

  2. steinuil commented on Oct 17, 2024

    @steinuil
    Author

    If you mean setting DWORD Enable SDL to 0 under HKLM\System\CurrentControlSet\Services\winebus, I just tried that and it doesn't work.

  3. steinuil commented on Oct 17, 2024

    @steinuil
    Author

    I'm not even convinced that key does anything, I grepped through the proton-9.0 tree and the only registry keys I found related to SDL that seem to do something are in these functions:

    static NTSTATUS sdl_driver_init(void)
    {
    struct sdl_bus_options bus_options;
    struct bus_main_params bus =
    {
    .name = L"SDL",
    .init_args = &bus_options,
    .init_code = sdl_init,
    .wait_code = sdl_wait,
    };
    NTSTATUS status;
    bus_options.split_controllers = check_bus_option(L"Split Controllers", 0);
    if (bus_options.split_controllers) TRACE("SDL controller splitting enabled\n");
    bus_options.map_controllers = check_bus_option(L"Map Controllers", 1);
    if (!bus_options.map_controllers) TRACE("SDL controller to XInput HID gamepad mapping disabled\n");
    sdl_bus_load_mappings(&bus_options);
    status = bus_main_thread_start(&bus);
    sdl_bus_free_mappings(&bus_options);
    return status;
    }
    static NTSTATUS udev_driver_init(void)
    {
    struct udev_bus_options bus_options;
    struct bus_main_params bus =
    {
    .name = L"UDEV",
    .init_args = &bus_options,
    .init_code = udev_init,
    .wait_code = udev_wait,
    };
    bus_options.disable_hidraw = check_bus_option(L"DisableHidraw", 0);
    if (bus_options.disable_hidraw) TRACE("UDEV hidraw devices disabled in registry\n");
    bus_options.disable_input = check_bus_option(L"DisableInput", 1);
    if (bus_options.disable_input) TRACE("UDEV input devices disabled in registry\n");
    bus_options.disable_udevd = check_bus_option(L"DisableUdevd", 0);
    if (bus_options.disable_udevd) TRACE("UDEV udevd use disabled in registry\n");
    return bus_main_thread_start(&bus);
    }

  4. zmtong1988 commented on Oct 17, 2024

    @zmtong1988
    Contributor

    I don't have device, so I'm not quite sure what happened.
    You can open the log "WINEDEBUG=+dinput,+xinput,+hid" to view the out content.

  5. cheako commented on Jun 13, 2025

    @cheako

    I have a similar problem. Here is what I've learned over the past two weeks, some things are from reading wine.org's gitlab. Firstly the requested button an axis assigned numbers must be contiguous, the HID/electrical docs just don't support anything else. All the other issues come from this.

    Let's take a look at two controllers and just looking at the buttons as it's clearest to see the issue.

    1. My HORI Steam pad. It registers 20 IDs, but only 18 are usable. Select and Start are 12 and 13, but default.
    2. A fictitious 8bit NES usb controller, 4 buttons 2 are select and start! Now the device could register 13 buttons, but I hope nobody does that! I hope such a controller registers the 4 buttons and assigns select and start to 2 and 3.

    The HORI pad has 2 as "options", it's just under start, and 3 is the first button on the top row. X or square.

    As such somewhere there needs to be an entry for every physical controller, even the $5 aliexpress NES controllers.

    More info here:
    Grumbel/jstest-gtk#30

    I'm going to look at this source to see what I can learn.
    I also did: https://gitlab.com/-/snippets/4863161

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions