using System; ////WIP //how is it achieved that this applies on a per-device level rather than for all devices of a given type? //do we do this at the event-level? //where to do perform the input modification? pre-source or post-source? //pre-source: // + can be persisted such that the outcome is agnostic to user profile settings // - no longer possible to have input routed to multiple users from same device // //post-source: // + no need to modify device ////REVIEW: add ability to have per-device (or device layout?) settings? namespace UnityEngine.InputSystem.Users { /// /// A user profile may alter select aspects of input behavior at runtime. /// /// /// This class implements several user adjustable input behaviors commonly found in games, such /// as mouse sensitivity and axis inversion. /// /// Note that the behaviors only work in combination with actions, that is, for users that have /// actions associated with them via . /// The behaviors do not alter the input as present directly on the devices. Meaning that, for example, /// will not impact of but will /// rather impact the value read out with from an action /// bound to mouse deltas. /// /// In other words, all the input behaviors operate at the binding level and modify s. /// ////REVIEW: does this really make sense? /// [Serializable] internal class InputUserSettings { /// /// Customized bindings for the user. /// /// /// This will only contain customizations explicitly applied to the user's bindings /// and will not contain default bindings. It is thus not a complete set of bindings /// but rather just a set of customizations. /// public string customBindings { get; set; } ////REVIEW: for this to impact position, too, we need to know the screen dimensions /// /// Invert X on and . /// public bool invertMouseX { get; set; } /// /// Invert Y on and . /// public bool invertMouseY { get; set; } /// /// Smooth mouse motion on both X and Y ... /// public float? mouseSmoothing { get; set; } public float? mouseSensitivity { get; set; } /// /// Invert X axis on and . /// public bool invertStickX { get; set; } /// /// Invert Y axis on and . /// public bool invertStickY { get; set; } /// /// If true, swap sides /// public bool swapSticks { get; set; } /// /// Swap and on gamepads. /// public bool swapBumpers { get; set; } /// /// Swap and on gamepads. /// public bool swapTriggers { get; set; } public bool swapDpadAndLeftStick { get; set; } public float vibrationStrength { get; set; } public virtual void Apply(IInputActionCollection actions) { //set overrideProcessors and redirectPaths on respective bindings } [SerializeField] private string m_CustomBindings; } }