Different Input System Package settings per platform

We’d like to have a different set of ‘Supported Devices’ on different platforms. For example on PC we support mouse, keyboard and all controllers, but on console we want to prohibit mouse and keyboard, and only support the controller type for that platform.

I can see in the Input System Package we can create multiple settings profiles, but the only way to switch between them appears to be in editor. Is that right? Ideally we’d want to do this in project settings somehow for each platform, or a prebuild script.

Basically, is there a sensible way to switch between a different set of ‘Supported Devices’ on different platforms that can be done as part of an automated build process?

Thanks,
Mike T

To anyone having a similar issue, it looks like we can set the supported devices for the current active input system profile, at runtime. Do something like this:

using UnityEngine.InputSystem;

#if UNITY_console_define_symbol

// only support controllers on the console we're interested in. Prohibit mouse and keyboard
string[] supportedDevices = { "Gamepad" };
InputSystem.settings.supportedDevices = new UnityEngine.InputSystem.Utilities.ReadOnlyArray<string>(supportedDevices);

#endif
1 Like