Class InputSettings
Project-wide input settings.
Inheritance
Namespace: UnityEngine.Experimental.Input
Syntax
public class InputSettings : ScriptableObject
Remarks
Several aspects of the input system can be customized to tailor how the system functions to the specific needs of a project.
Properties
actionUpdateMode
Declaration
public InputSettings.ActionUpdateMode actionUpdateMode { get; set; }
Property Value
Type | Description |
---|---|
InputSettings.ActionUpdateMode |
compensateForScreenOrientation
If true, sensors that deliver rotation values on handheld devices will automatically adjust rotations when the screen orientation changes.
Declaration
public bool compensateForScreenOrientation { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Remarks
This is enabled by default.
If enabled, rotation values will be rotated around Z. In
Sensors affected by this setting are Accelerometer,
defaultButtonPressPoint
Declaration
public float defaultButtonPressPoint { get; set; }
Property Value
Type | Description |
---|---|
System.Single |
defaultDeadzoneMax
Default value used when nothing is set explicitly on
Declaration
public float defaultDeadzoneMax { get; set; }
Property Value
Type | Description |
---|---|
System.Single |
defaultDeadzoneMin
Default value used when nothing is set explicitly on
Declaration
public float defaultDeadzoneMin { get; set; }
Property Value
Type | Description |
---|---|
System.Single |
defaultHoldTime
Declaration
public float defaultHoldTime { get; set; }
Property Value
Type | Description |
---|---|
System.Single |
defaultSensitivity
Default mouse/pen/touch sensitivity for motion deltas. This only applies when using
Declaration
public float defaultSensitivity { get; set; }
Property Value
Type | Description |
---|---|
System.Single |
Remarks
Pointer deltas flow into the system in pixel space. This means that the values are dependent on resolution and are relatively large. Whereas a gamepad thumbstick axis will have normalized values between [0..1], a pointer delta will easily be in the range of tens or even hundreds of pixels.
Pointer sensitivity scaling allows to turn these pointer deltas into useful, partially resolution-independent floating-point values.
The value determines how much travel is generated on the delta for each percent of travel across the window space. If, for example, the mouse moves 15 pixels on the X axis and -20 pixels on the Y axis, and if the player window is 640x480 pixels and the sensitivity setting is 0.5, then the generated pointer delta value will be (15/6406, -20/4806) = (0.14, -0.25).
See Also
defaultSlowTapTime
Declaration
public float defaultSlowTapTime { get; set; }
Property Value
Type | Description |
---|---|
System.Single |
defaultTapTime
Declaration
public float defaultTapTime { get; set; }
Property Value
Type | Description |
---|---|
System.Single |
filterNoiseOnCurrent
Declaration
public bool filterNoiseOnCurrent { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
runInBackground
If enabled, input will be collected and processed while the application is running in the background (i.e. when = the application does not have focus).
Declaration
public bool runInBackground { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Remarks
This is disabled by default.
Note that it depends both on the platform as well as the specific devices being used what input will actually be collected when running in the background. To query the ability of a specific device to collect input while in the background, use canRunInBackground.
In general, collecting input while running in the background only works on desktop platforms.
Also note that for processing of input to occur,
See Also
supportedDevices
List of device layouts used by the project.
Declaration
public ReadOnlyArray<string> supportedDevices { get; set; }
Property Value
Type | Description |
---|---|
ReadOnlyArray<System.String> |
Remarks
This would usually be one of the high-level abstract device layouts. For example, for
a game that supports touch, gamepad, and keyboard&mouse, the list would be
{ "Touchscreen", "Gamepad", "Mouse", "Keyboard" }
. However, nothing prevents the
the user from adding something a lot more specific. A game that can only be played
with a DualShock controller could make this list just be { "DualShockGamepad" }
,
for example.
In the editor, we use the information to filter what we display to the user by automatically filtering out irrelevant controls in the control picker and such.
The information is also used when a new device is discovered. If the device is not listed as supported by the project, it is ignored.
The list is empty by default. An empty list indicates that no restrictions are placed on what devices are supported. In this editor, this means that all possible devices and controls are shown.
timesliceEvents
If enabled, any given input event will only be processed for any given fixed or dynamic update if it has been generated before or within the time slice allotted to the update.
Declaration
public bool timesliceEvents { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Remarks
Normally, the input system will directly consume any input that's available regardless of when it was produced.
updateMode
Determine how the input system updates, i.e. processing pending input events.
Declaration
public InputSettings.UpdateMode updateMode { get; set; }
Property Value
Type | Description |
---|---|
InputSettings.UpdateMode |