All notable changes to the input system package will be documented in this file.
The format is based on Keep a Changelog and this project adheres to Semantic Versioning.
Due to package verification, the latest version below is the unpublished version and the date is meaningless. however, it has to be formatted properly to pass verification tests.
TrackedDeviceRaycaster
when disabling built-in XR module.VirtualMouseInput
not moving the software cursor when set to HardwareCursorIsAvailable
but not having a hardware cursor ()InputSystem.RegisterLayout
.InputControlPath.TryGetControlLayout
no longer throws NotImplementedException
for <Mouse>/scroll/x
and similar paths where the layout is modifying a control it inherited from its base layout (thread).NotImplementedException
when matching against a field of InputDeviceDescription.capabilities
when the value of the field used scientific notation.InputDeviceDescription.capabilities
by prefix only (i.e. previously it would find the field "foo" when actually looking for "foobar").InputUser.UnpairDevices()
corrupting user device list.PlayerInput
with the SendMessages
or BroadcastMessages
behavior. Previously, an incorrect method name was generated (fix contributed by BHSPitMonkey in #1022; case 1214519).expectedControlType
to Button
as expected (case 1221015).PlayerInputManager
from button presses no longer fail if there are multiple devices of the same type present and the join was not on the first gamepad (case 226920).PlayerInputEditor
no longer leads to the player's InputActionAsset
mistakenly getting replaced with a clone when the inspector is open on a PlayerInput
component (case 1228636).Xbox One Gamepad (on XB1)
when using them in control schemes. Also, it will no longer filter out controls from base layouts (such as Gamepad
) (case 1219415).RebindOperation
s will no longer pick controls right away that are already actuated above the magnitude threshold when the operation starts. Instead, these controls will have to change their actuation from their initial level such that they cross the magnitude threshold configured in the operation (case 1215784)..inputactions
editor are no longer force-expanded on every domain reload and whenever a new action or binding is added..inputactions
assets will now check out from version control the generated .cs file when overwriting it – which only happens if the contents differ (case 1222972)..inputactions
assets will now check out from version control the asset before saving it.InputActionReference
objects created by the importer for .inputactions
files are no longer broken when the action referenced by the object is renamed (case 1229145).
InputActionReference
instances. The problem was inherent in the internal file IDs generated for actions – which were affected by action and map names. Thus, changing the name of an action or map would change the resulting file ID of the InputActionReference
.InputActionReference
objects under their original file ID. We hide them in the Project Browser, however. The ones that are visible now have the new, fixed file IDs.InputActionReference
properties to the new file IDs, simply replace them with the newly created InputActionReference
.InputDevice.all
has been deprecated due to the confusion it creates with other getters like Gamepad.all
. Use InputSystem.devices
instead (case 1231216).
Joystick.all
getter that works the same as Gamepad.all
.InputSystemUIInputModule.trackedDeviceSelect
has been removed. Use InputSystemUIInputModule.leftClick
instead.InputSystemUIInputModule.repeatDelay
has been renamed to moveRepeatDelay
and repeatRate
has been renamed to moveRepeatRate
.new
with the PlayerInput.camera property
(case 1174688).InputSystemUIInputModule
.
lastPress
on PointerEventData
getting lost.(0,0)
positions.TrackedDeviceRaycaster
not setting screenPosition
in RaycastResult
.InputSystemUIInputModule
) with enabling&disabling of entire action maps (as, for example, performed by PlayerInput
) no longer leaves to unresponsive input and "should not reach here"
assertions (forum thread).PressInteraction
no longer misses the next button press if it gets reset from within the performed
callback (case 1205285).InputBinding.DisplayStringOptions.DontIncludeInteractions
is now properly respected.InputSystem.onActionChange
getting invoked too many times on binding changes.InputSystemUIInputModule
now sends pointer events using a new ExtendedPointerEventData
instead of using the base PointerEventData
class. This surfaces additional input data in pointer events.InputSystemUIInputModule.pointerBehavior
to allow dictating how the UI will resolve concurrent input from multiple pointers.InputAction.CallbackContext.ReadValueAsButton
.InputAction.started
, InputAction.performed
, and InputAction.canceled
. Which of the callbacks were triggered and in what order depended on a number of factors, the biggest influencer of which were the different interactions that could be applied to actions (like Press
or Hold
).Press
interaction to the Click
action of InputSystemUIInputModule
would cause the click state to get stuck because the click action would never cancel.InputAction.started
first. If this is not done explicitly, it happens implicitly.InputAction.canceled
before going back to waiting state. Like with InputAction.started
, if this isn't done explicitly, it will happen implicitly. This implies that InputAction.canceled
no longer signifies an action getting aborted because it stopped after it started but before it performed. It now simply means "the action has ended" whether it actually got performed or not.InputAction.started
and InputAction.canceled
, InputAction.performed
may be triggered arbitrary many times (including not at all).PressInteraction
has been tweaked and now is the following:
Press Only
: Starts and immediately performs when pressed, then stays performed and cancels when button is released.Release Only
: Starts when button is pressed and then performs and immediately cancels when the button is released.Press And Release
: Starts and immediately performs when button is pressed, then stays performed and performs again and immediately cancels when button is released.Vector2Composite
now has a mode
parameter which can be used to choose between DigitalNormalized
(the default), Digital
(same as DigitalNormalized
but does not normalize the resulting vector), and Analog
(uses float input values as is).
Vector2Composite.normalize
has been deprecated. Note that it will not work together with Analog
. The parameter will be removed in the future.InputSystemUIInputModule
no longer generates GC heap garbage every time mouse events are processed.InputUser
and Touch
.PlayerInputManager
not joining players correctly if a scheme has more than one device requirement has been fixed.
PlayerInputManager
will no longer join players when control schemes are used and none of the schemes produces a successful match based on the devices available for the join.ArgumentOutOfRangeException
(case 1192972).ArgumentException
when turning the same PlayerInput
on and off (case 1198889).StackOverflowException
when Invoke Unity Events
is selected in PlayerInput
and it cannot find an action (#1033).HoldInteraction
now stays performed after timer has expired and cancels only on release of the control (case 1195498).Simple Multiplayer
sample which demonstrates a simple, bare-bones local multiplayer setup.Gamepad Mouse Cursor
sample that shows how to drive a UI mouse cursor using the gamepad.
VirtualMouseInput
component that does most of the work.Deselect On Background Click
option to InputSystemUIInputModule
. This allows toggling the behavior off where clicking the mouse and not hitting a GameObject
will automatically clear the current selection -- which will break keyboard and gamepad navigation.This release includes a number of Quality-of-Life improvements for a range of common problems that users have reported.
To aid in debugging issues, we've extended the system's event tracing and replay functionality to allow persisting and replaying arbitrary input event streams.
InputEventTrace
now has APIs to persist the events to disk and to load them back in from previously persisted event streams. The same API can be used to persist in arbitrary C# Stream
instances, not just in file streams.
```CSharp
// Write.
myTrace.WriteTo("file.inputtrace");// Read. InputEventTrace.LoadFrom("file.inputtrace");
* `InputEventTrace` now has built-in replay functionality.
```CSharp
myTrace.Replay().PlayAllFramesOneByOne();
We've added a new InputRecording
sample which has a reusable MonoBehaviour
component that can be used to capture and replay device activity.
Keyboard
now has a FindKeyOnCurrentKeyboardLayout
method to look up key controls by their display names.
Keyboards now have synthetic controls that combine left and right variants of modifier keys.
This means that you can bind to just "shift" now, for example, instead of having to bind to both "left shift" and "right shift".
new InputAction(binding: "<Keyboard>/shift");
Keyboard
.
```CSharp
if (Keyboard.current.shiftKey.isPressed) /* ... */;// Is equivalent to: if (Keyboard.current.leftShiftKey.isPressed || Keyboard.current.rightShiftKey.isPressed) /* ... */; ```
PlayerInput
now has a new Controls Changed
event/message which is triggered when the control setup of the player changes (e.g. when switching control schemes).
public void OnControlsChanged()
{
// Update UI display hints, for example...
}
CSharp
// Takes things such as currently bound controls and active binding masks into account
// and can handle composites.
action.GetBindingDisplayString();
Related to this, custom binding composites can now be annotated with the new DisplayStringFormat
attribute to control how composites as a whole are turned into display strings.
[DisplayStringFormat("{button}+{stick}")]
public class MyComposite : InputBindingComposite<Vector2>
{
[InputControl(layout = "Button")] public int button;
[InputControl(layout = "Stick")] public int stick;
}
InputActionRebindingExtension.RebindingOperation
has a new configuration method WithMatchingEventsBeingSuppressed
which allows suitable input events to automatically be swallowed while a rebind is ongoing. This greatly helps with not having something else respond to input while a rebind is in progress.RequestResetCommand
for each device is also sent to the backend but regardless of whether the device responds or not, the input state for the device will be overwritten to default.Application.runInBackground
is true
, all devices that return true
from InputDevice.canRunInBackground
are exempted from resets entirely. This, for example, allows XR devices to continue running regardless of focus change.InputControlExtensions.GetStatePtrFromStateEvent
no longer throws InvalidOperationException
when the state format for the event does not match that of the device. It simply returns null
instead (same as when control is found in the event's state).InputEventTrace
instances are no longer disposed automatically from their finalizer but MUST be disposed of explicitly using Dispose()
.InputActionRebindingExtensions.PerformInteractiveRebinding
has been greatly enhanced to apply a wide range of default configurations to the rebind. This greatly reduces the need to manually configure the resulting rebind.
CSharp
// Start a rebind with the default configuration.
myAction.PerformInteractiveRebinding().Start();
Pointer position input will be ignored by default.
If not a suitable binding target itself, <Keyboard>/escape
will automatically be made to quit the rebind.
Events with control input not explicitly matching exclusions will now get suppressed. This prevents input actions from getting triggered while a rebind is in progress.
The expected control type is automatically adjusted if a part binding of a composite is targeted by the rebind (e.g. if the action expects a Vector2
but the part binding expects a Button
, the rebind switches automatically to Button
).
If the targeted binding is part of a control scheme, controls will automatically be restricted to match the device requirements of the control scheme. For example, if the binding belongs to a "Keyboard&Mouse" scheme that has <Keyboard>
and a <Mouse>
requirement, the rebind will ignore input on gamepads.
As before, you can always create a RebindingOperation
from scratch yourself or wipe/alter the configuration returned by PerformInteractiveRebinding
however you see fit.
Control schemes can now handle ambiguity.
score
property on InputControlScheme.MatchResult
, no code changes are necessary to take advantage of this feature.PlayerInput.active
has been renamed to PlayerInput.inputIsActive
to avoid ambiguities with GameObject
activation.
InputUser
in combination with touchscreens no longer throws InvalidOperationException
complaining about incorrect state format.
InputControlExtensions.GetStatePtrFromStateEvent
now works with touch events, too.InputTestFixture.currentTime
getter.TrackedDevice
layout is no longer incorrectly registered as Tracked Device
.IndexOutOfRangeException
being thrown when looking up controls on XR devices.StandaloneInputModule
, the resulting operation is now undoable and will properly dirty the scene.LayoutNotFoundException
being thrown when InputControlPath.ToHumanReadableString
referenced a layout that could not be found.EditorWindow
code is now performed regardless of focus or the setting of Lock Input to Game View
in the input debugger.[InitializeOnLoad]
code being lost on domain reload (case 1192379).
[InitializeOnLoad]
code that accessed the input system in the project and the RegisterLayout
for the custom device happened to not be the first in sequence.touchpadClicked
& touchpadPressed
) now report accurate data.DefaultInputActions.inputactions
for navigation in UI.InputActionAsset
to a InputSystemUIInputModule
will no longer look up action names globally but rather only look for actions that are located in action maps with the same name.
point
action was bound to UI/Point
to an asset that had no UI
action map but did have an action called Point
somewhere else, it would erroneously pick the most likely unrelated Point
action for use by the UI.AxisDeadzoneProcessor
and StickDeadzoneProcessor
that link min
and max
values to input settings.PlayerInput
not pairing devices added after it was enabled when not having control schemes.
SimpleDemo
sample when having the CustomDeviceUsages
sample installed as well. Gamepads would not get picked up in that case.ArgumentNullException
when adding a device and a binding in an action map had an empty path (case 1187163).EditorWindow Demo
sample that illustrates how to use the input system in editor UI code.Destroy
the generated Asset in a finalizer, but instead implement IDisposable
.1.0-preview
.
IsPointerOverGameObject
method for InputSystemUIInputModule
.InputSystem.RegisterLayoutOverrides
).
1.0-preview
, layout overrides could lead to corruption of the layout state and would also not be handled correctly by the various editor UIs.PlayerInput
).anyKey
not appearing in control picker for Keyboard
.PlayerInput
creating an asset with an incorrect binding for taps on Touchscreens. \
NOTE: If you have already created an .inputactions asset with this mechanism, update "tap [Touchscreen]" to "Primary Touch/Tap" to fix the problem manually.Invoke CSharp Events
when selected in PlayerInput
not triggering PlayerInput.onActionTriggered
.Gamepad
to allow distinguishing two gamepads in bindings based on which player the gamepad is assigned to.TrackedDevice
input device class as the basis for various kinds of tracked devices.CallbackContext.ReadValue
throwing when invoked during device removalVisualizers
sample if respective device was not present on system (e.g. in PenVisualizer
if no pen was present in system).IInputInteraction.Process
not working as expected when processing happened in response to previous timeout expiring (#714).HIDSupport.shouldCreateHID
event with a new HIDSupport.supportedHIDUsages
property, which takes an array of supported usages.PlayerInput.neverAutoSwitchControlSchemes
to disable logic that automatically enables control scheme switching when there is only a single PlayerInput
in the game.PlayerInput.SwitchControlScheme
to switch schemes manually.InputSystem.onEvent
callbacks.X
and Y
controls on HIDs when there is a Stick/X
and Stick/Y
added for the device.trigger
control. Previously, the trigger control on the joystick was left pointing to random state.<XInputController>/buttonSouth
was shown as rightShoulder [XInputController]
, the same binding will now show as A [Xbox Controller]
.PlayerInput.Instantiate
now correctly sets up a given control scheme, if specified.
controlScheme:
argument, the result used to be a correctly assigned control scheme at the InputUser
level but no restrictions being actually applied to the bindings, i.e. every single binding was active regardless of the specified control scheme.RebindingOperation
.InputUser.onUnpairedDeviceUsed
now receives a 2nd argument which is the event that triggered the callback.
InputControlPath.ToHumanReadableString
now takes display names from registered InputControlLayout
instances into account.
AxisControl.clamp
is now an enum-valued property rather than a bool. Can now perform clamping before normalization.InputAction.Enable
.InputControlScheme.baseScheme
API and basedOn
serialized property. This was never fully implemented.InputDeviceDescription
of the device in JSON format to the system clipboard.
XInputController
and XboxOneGamepad
no longer have two extraneous, non-functional "menu" and "view" buttons.InputUser.onUnpairedDeviceUser
ignoring input on controls that do not support EvaluateMagnitude
.
PlayerInput
would not initialize a control scheme switch from a <Mouse>/delta
binding as the delta X and Y axes do not have min&max limits and thus return -1 from EvaluateMagnitude
.NullReferenceException
when the input debugger is open with actions being enabled.timesliceEvents
setting - and made this tied to the update mode instead. We now always time slice when using fixed updates, and not when using dynamic updates.2D Vector
composite as an option on a floating-point button action.InputState.onChange
callback now receives a second argument which is the event (if any) that triggered the state change on the device.InputSystemUIInputModule
can now track multiple pointing devices separately, to allow multi-touch input - required to allow control of multiple On-Scree controls at the same time with different fingers.ButtonWithOneModifier
can be used to represent shortcut-like bindings such as "CTRL+1".ButtonWithTwoModifiers
can be used to represent shortcut-like bindings such as "CTRL+SHIFT+1".RebindingOperation
will now fall back to the default path generation behavior if the callback provided to OnGeneratePath
returns null.PlayerInput
will now copy overrides when creating duplicate actions.effectivePath
.SimpleDemo
. You can install the sample from the package manager. See the README.md file for details about the sample.InputEventPtr.IsA
to be allocated on the heap.duration
values reported for Hold and Press interactions.InputControlList
.MouseState
, KeyboardState
, and GamepadState
have been made public again.PlayerInput
and PlayerInputManager
have been moved from the UnityEngine.InputSystem.PlayerInput
namespace to UnityEngine.InputSystem
.The signature of InputSystem.onEvent
has changed. The callback now takes a second argument which is the device the given event is sent to (null if there's no corresponding InputDevice
).
// Before:
InputSystem.onEvent +=
eventPtr =>
{
var device = InputSystem.GetDeviceById(eventPtr.deviceId);
//...
};
// Now:
InputSystem.onEvent +=
(eventPtr, device) =>
{
//...
};
The signatures of InputSystem.onBeforeUpdate
and InputSystem.onAfterUpdate
have changed. The callbacks no longer receive an InputUpdateType
argument.
InputState.currentUpdateType
in case you need to know the type of update being run.InputUpdateType
has been moved to the UnityEngine.InputSystem.LowLevel
namespace.
InputSystem.Update(InputUpdateType)
has been removed from the public API.
The way input devices are built internally has been streamlined.
InputDeviceBuilder
is now internal. It is no longer necessary to access it to look up child controls. Simply use InputControl.GetChildControl
instead.To build a device without adding it to the system, call the newly added InputDevice.Build
method.
InputDevice.Build<Mouse>();
InputSystem.SetLayoutVariant
has been removed. Layout variants can no longer be set retroactively but must be decided on as part of device creation.
InputSystem.RegisterControlProcessor
has been renamed to just InputSystem.RegisterProcessor
.
InputAction.ReadValue<TValue>()
is longer correlated to InputAction.triggered
. It simply returns the current value of a bound control or composite while the action is being interacted with.InputInteractionContext.PerformedAndGoBackToWaiting
has been renamed to just InputInteractionContext.Performed
.InputSystem.AddDeviceUsage(device,usage)
to add additional usages to a device.InputSystem.RemoveDeviceUsage(device,usage)
to remove existing usages from a device.InputSystem.SetDeviceUsage(device,usage)
still exists. It will clear all existing usages from the given device.VisualizerSamples
sample that can be installed through the package manager.
InputControlVisualizer
and InputActionVisualizer
that help visualizing/debugging control/device and action activity through in-game overlays. A few sample scenes illustrate how to use them.InputAction.ReadValueAsObject
API.InputAction.activeControl
API.InlinedArray.RemoveAtByMovingTailWithCapacity
, which could cause data corruption.InputSystemUIInputModule
not being smooth.CallbackContext.control
referencing the composite member control which was actually actuated for this trigger for composite bindings.Touchscreen.touch[0..9]
are now bindable from the control picker.Touchscreen.primaryTouch
is now a separate control which tracks the primary touch on the screen.Touchscreen
inherits from Pointer
(such as position
, phase
, and delta
) are now tied to Touchscreen.primaryTouch
and allow for Touchscreen
to function as a generic Pointer
(like Mouse
and Pen
).Touchscreen.press
(renamed from Touchscreen.button
) is now a working, synthetic button that is down whenever at least one finger is on the screen.TouchControl.startPosition
gives the starting position of the touch.TouchControl.startTime
gives the starting time of the touch.Touchscreen
.InputSettings.defaultTapTime
.InputSettings.tapRadius
.TouchControl.tap
is a new button control that triggers then the touch is tapped. Note that this happens instantly when a touch ends. The button will go to 1 and immediately go back to 0. This means that polling the button in Update
, for example, will never trigger a tap. Either use actions to observe the button or use the Touch
API from EnhancedTouch
to poll taps.Touchscreen.activeTouches
has been removed. Use Touch.activeTouches
from the new enhanced touch API instead for more reliable touch tracking.Touchscreen.allTouchControls
has been renamed to Touchscreen.touches
.EnhancedTouch
plugin has been added which offers an enhanced Touch
and Finger
API to reliably track touches and fingers across updates. This obsoletes the need to manually track touch IDs and phases and gives access to individual touch history.TouchSimulation.Enable()
or put the TouchSimulation
MonoBehaviour in your scene. Also, in the input debugger, you can now enable touch simulation from the "Options" dropdown.Changing state has been decoupled from events. While input events are the primary means by which to trigger state changes, anyone can perform state changes manually now from anywhere.
InputState.Change(gamepad.leftStick, new Vector2(123, 234));
A new API for recording state changes over time has been added.
var history = new InputStateHistory("<Gamepad>/leftStick");
history.StartRecording();
//...
foreach (var record in history)
Debug.Log(record);
Added support for generic joysticks on WebGL (which don't use the standard gamepad mapping).
Added support for DualShock 3 gamepads on desktops.
Added support for Nintendo Switch Pro Controllers on desktops.
InputAction.triggered
is true if the action was performed in the current frame.InputAction.ReadValue<TValue>()
yields the last value that started
, performed
, or cancelled
(whichever came last) was called with. If the action is disabled, returns default(TValue)
. For InputActionType.Button
type actions, returns 1.0f
if triggered==true
and 0.0f
otherwise../foo/bar.cs
).FixedUpdate()
or before each Update()
.
ProcessEventInFixedUpdates
and get events timesliced to individual FixedUpdate
periods according to their timestamps.InputSettings.UpdateMode.ProcessEventsInBothFixedAndDynamicUpdate
has been removed.InputSettings.UpdateMode.ProcessEventsInDynamicUpdateOnly
has been renamed to InputSettings.UpdateMode.ProcessEventsInDynamicUpdate
and is now the default.InputSettings.UpdateMode.ProcessEventsInFixedUpdateOnly
has been renamed to InputSettings.UpdateMode.ProcessEventsInFixedUpdate
.Keyboard
IME properties (imeEnabled
, imeCursorPosition
) to methods (SetIMEEnabled
, SetIMECursorPosition
).IInputRuntime
properties.GetXxx
methods in our API with xxx
properties.Pointer.phase
has been removed and PointerPhase
has been renamed to TouchPhase
. Phases are now specific to touch. PointerPhaseControl
has been renamed to TouchPhaseControl
.Pointer.button
has been renamed to Pointer.press
and now is a control that indicates whether the pointer is in "press down" state.
IInputStateChangeMonitor
and friends) have been moved out of InputSystem
into a new static class InputState
in UnityEngine.Experimental.Input.LowLevel
.
InputSystem
reduces the API surface visible to most users.InputDeviceChange.StateChanged
has been removed and is now a separate callback InputState.onChange
.
InputDeviceChange
notifications are low-frequency whereas StateChanged
is high-frequency. Putting them all on the same callback made adding a callback to InputSystem.onDeviceChange
unnecessarily expensive.IInputStateCallbackReceiver
has been rewritten from scratch. Now has two simple methods OnNextUpdate
and OnEvent
. If implemented by a device, the device now has completely control over changing its own state. Use the InputState.Change
methods to affect state changes while trigger state change monitors (e.g. for actions) correctly.InputSystemUIInputModule
by having only one set of actions for all XR devices.IInputStateTypeInfo
implementations internal, as these did not offer value to the user.IInputDeviceCommandInfo
implementations internal, as these did not offer value to the user.ReadWriteArray
, which was only used for making RebindingOperation.scores
editable, which did not add any value.PrimitiveValueOrArray
, as non of it's functionality over PrimitiveValue
was implemented.InputProcessor
implementation internal, as access to these types is exposed only through text mode representations.CurveProcessor
as it was not implemented.InputAction.continuous
has been removed. Running logic every frame regardless of input can easily be achieved in game code.Action Type
: Determines the behavior of the action. Choices are Value
, Button
, and PassThrough
.Control Type
: Determines the type of control (and implicitly the type of value) the action is looking for if the action is a Value
or PassThrough
action.Initial State Check
toggle is now implicit in the action type now. Value
actions perform an initial state check (i.e. trigger if their control is already actuated when the action is enabled). Other types of actions don't.Pass Through
toggle is now rolled into the action type.MultiplayerEventSystem
class, which allows you use multiple UI event systems to control different parts of the UI by different players.InputSystemUIInputModule
now lets you specify an InputActionAsset
in the actionsAsset
property. If this is set, the inspector will populate all actions from this asset. If you have a PlayerInput
component on the same game object, referencing the same InputActionAsset
, the PlayerInput
component will keep the actions on the InputSystemUIInputModule
in synch, allowing easy setup of multiplayer UI systems.StickControl.x
and StickControl.y
are now deadzoned, i.e. have AxisDeadzone
processors on them. This affects all gamepads and joysticks.
x
and y
have linear deadzones. This means that leftStick.ReadValue().x
is not necessary equal to leftStick.x.ReadValue()
.Gamepad.current
.Redesigned UIActionInputModule
clickSpeed
property - will use native click counts from the OS where available instead.sendEventsWhenInBackground
property.Touches
and TrackedDevices
until we decide how to handle them.moveDeadzone
property as it is made redundant by the action's dead zone.UIActionInputModuleEnabler
component, UIActionInputModule
will now enable itself.Changed default button press point to 0.5.
Changed all constants in public API to match Unity naming conventions ("Constant" instead of "kConstant").
Changed namespace from UnityEngine.Experimental.Input
to UnityEngine.InputSystem
.
Generated wrapper code now has nicer formatting.
Renamed UIActionInputModule
to InputSystemUIInputModule
.
Nicer icons for InputActionAssets
and InputActions
and for Button
and generic controls.
Change all public API using IntPtr
to use unsafe pointer types instead.
PlayerInput
will no longer disable any actions not in the currently active action map when disabling input or switching action maps.
Change some public fields into properties.
Input System project settings are now called "Input System Package" in the project window instead of "Input (NEW)".
Removed Plugins
from all namespaces.
Rename "Cancelled" -> "Canceled" (US spelling) in all APIs.
UIActionInputModule
.PlayerInput
no longer adds duplicates of action events if Invoke Unity Events
notification behavior is selected.Hold
interactions firing immediately before the duration has passed.InputAction
fields in the inspector (Changes wouldn't persist before).CallbackContext.ReadValue<TValue>()
for an action with a composite binding with TValue
not matching the composite's value type.PlayerInput
can now handle .inputactions
assets that have no control schemes.
clickCount
control to the Mouse
class, which specifies the click count for the last mouse click (to allow distinguishing between single-, double- and multi-clicks).New API for changing bindings on actions
// Several variations exist that allow to look up bindings in various ways.
myAction.ChangeBindingWithPath("<Gamepad>/buttonSouth")
.WithPath("<Keyboard>/space");
// Can also replace the binding wholesale.
myAction.ChangeBindingWithPath("<Keyboard>/space")
.To(new InputBinding { ... });
// Can also remove bindings programmatically now.
myAction.ChangeBindingWithPath("<Keyboard>/space").Erase();
Joystick.axes
and Joystick.buttons
have been removed.InputActionAssetReference
has been removed.InputSettings.runInBackground
has been removed. This should now be supported or not on a per-device level. Most devices never supported it in the first place, so a global setting did not seem to be useful.Sensor
-based classes have been added. Various existing Android sensor implementations are now based on them.InputControlLayoutAttribute
is no longer inherited.
RegisterLayout
. A class derived from it will usually be registered the same way. Because of layout inheritance, properties applied to the base class through InputControlLayoutAttribute
will affect the subclass as intended. Not inheriting the attribute itself, however, now allows having properties such as isGenericTypeOfDevice
which should not be inherited.acceleration
, orientation
, and angularVelocity
controls from DualShockGamepad
base class.
DualShockGamepadPS4
.HIDSupport.supportedUsages
to enable specific usage types.InputTestFixture
class still is for when you want to write input-related tests for your project. You can reference the Unity.InputSystem.TestFixture
assembly when you need to do that.<Keyboard>/#(a)
binds to the control on a Keyboard
with the display name a
.continuous
flag is now ignored for Press and Release
interactions, as it did not make sense.initialStateCheck
property in code.
<Keyboard>/escape
is used in one action map to toggle into the main menu and in another action map to toggle out of it, then the previous behavior would immediately exit out of the menu if escape
was still pressed from going into the menu. \
We have come to believe that wanting to react to the current state of a control right away is the less often desirable behavior and so have made it optional with a separate toggle.InputAction.lastTriggerXXX
APIs have been removed.
lastActionXXX
APIs were trying to (imperfectly) solve.Tap
, SlowTap
, and MultiTap
interactions now respect button press points.Tap
, SlowTap
, and MultiTap
interactions now have improved parameter editing UIs.MonoBehavior.Awake
, MonoBehaviour.Start
, and MonoBehaviour.OnEnable
in player or when entering play mode in editor.InputEventTrace
could get corrupted.InputActionRebindingExceptions.RebindOperation
can now be reused as intended; used to stop working properly the first time a rebind completed or was cancelled.PressInteraction
set to ReleaseOnly
(#492).PlayerInput
no longer fails to find actions when using UnityEvents (#500)."{...}"
format for referencing action maps and actions using GUIDs as strings has been obsoleted. It will still work but adding the extra braces is no longer necessary.Press
and Release
interactions will now work correctly if they have multiple bound controls.Release
interactions will now invoke a Started
callback when the control is pressed.NOTE: The UI code for editing actions has largely been rewritten. There may be regressions. NOTE: The minimum version requirement for the new input system has been bumped
to 2019.1
g:Gamepad
filters bindings to those in the "Gamepad" group.d:Gamepad
filters bindings to those from Gamepad-compatible devices.performed
callback on both press and release (instead of invoking performed
and cancel
, which was inconsistent with other behaviors).{GLOBAL}
for added visibility.Pointer
will now be shown when the filter is Mouse
.The public control picker API has been revised.
The simplest way to add control picker UI to a control path is to add an InputControlAttribute
to the field.
// In the inspector, shows full UI to select a control interactively
// (including interactive picking through device input).
[InputControl(layout = "Button")]
private string buttonControlPath;
Processors of incompatible types will now be ignored instead of throwing an exception.
InputSettings.UpdateMode.ProcessEventsManually
now correctly triggers updates when calling InputSystem.Update(InputUpdateType.Manual)
.startTime
and duration
properties of action callbacks.This release contains a number of fairly significant changes. The focus has been on further improving the action system to make it easier to use as well as to make it work more reliably and predictably.
NOTE: There are some breaking changes. Please see the "Changed" section below.
IInputControlProcessor<TValue>
has been replaced with InputProcessor
and InputProcessor<TValue>
base classes.IInputBindingComposite
has been replaced with an InputBindingComposite
base class and the IInputBindingComposite<TValue>
interface has been merged with the InputBindingComposite<TValue>
class which had already existed.InputUser.onUnpairedDeviceUser
will now notify for each actuated control until the device is paired or there are no more actuated controls.SensitivityProcessor
has been removed.
SensitivityProcessor
did caused more problems than it solved.IInputStateCallbacks
(such as Touchscreen
) are allowed to go back in time. Avoids the problem of having to order events between multiple fingers correctly or seeing events getting rejected.PenState.Button
is now PenButton
.Bindings that have no interactions on them will trigger differently now. This is a breaking change.
performed
on every value change including when going back to their default value. This is why you would see two calls of performed
with a button; one when the button was pressed, another when it was depressed.started
and then performed
when a bound control is actuated. Thereafter, the action will remain in Started
phase. For as long as the control is actuated, every value change will trigger performed
again. When the control stops being actuated, it will trigger cancelled
and the action will remain in Waiting
state.InputControl.EvaluateMagnitude
) greater than zero. If a control does not support magnitudes (returns -1 from EvaluateMagnitude
), then the control is considered actuated when it changes state away from its default state.To restore the previous behavior, simply change code like
myAction.performed += MyCallback;
to
myAction.performed += MyCallback;
myAction.cancelled += MyCallback;
Alternatively, enable passThrough
mode on an action. This effectively restores the previous default behavior of actions.
new InputAction(binding: "<Gamepad>/leftTrigger") { passThrough = true };
As part of the aforementioned change, the following interactions have been removed as they are no longer relevant:
StickInteraction
: Can simply be removed from bindings. The new default behavior obsoletes the need for what StickInteraction
did. Use started
to know then the stick starts being actuated, performed
to be updated on movements, and cancelled
to know when the stick goes back into rest position.PressAndReleaseInteraction
: Can simply be removed from bindings. The default behavior with no interaction encompasses press and release detection. Use started
to know then a button is pressed and cancelled
to know when it is released. To set a custom button press point, simply put an AxisDeadzoneProcessor
on the binding.PressInteraction
has been completely rewritten.
behavior
parameter and now provides options for observing just presses (PressOnly
), just releases (ReleaseOnly
), or both presses and releases (PressAndRelease
).If bound controls are already actuated when an action is enabled, the action will now trigger in the next input update as if the control had just been moved from non-actuated to actuated state.
When an action is disabled, it will now cancel all ongoing interactions, if any (i.e. you will see InputAction.cancelled
being called).
Actions that at runtime are bound to multiple controls will now perform conflict resolution, if necessary.
Action editor now closes when asset is deleted.
Interactions and processors in the UI are now filtered based on the type of the action (if set) and sorted by name.
Renamed "Axis" and "Dpad" composites to "1D Axis" and "2D Vector" composite.
DpadComposite
got renamed to Vector2Composite
; AxisComposite
is unchanged.InputInteractionContext.controlHasDefaultValue
has been replaced with InputInteractionContext.ControlIsActuated()
.
InputActionChange.BindingsHaveChangedWhileEnabled
has been reworked and split in two:
InputActionChange.BoundControlsAboutToChange
: Bindings have been previously resolved but are about to be re-resolved.InputActionChange.BoundControlsChanged
: Bindings have been resolved on one or more actions.Actions internally now allocate unmanaged memory.
Dispose
as well). If you see errors in the console log about unmanaged memory being leaked, please report the bug.PlayerInput
component which simplifies setting up individual player input actions and device pairings. \
PlayerInputManager
component which simplifies player joining and split-screen setups. \
InputDevice.all
(equivalent to InputSystem.devices
)InputControl.IsActuated()
can be used to determine whether control is currently actuated (defined as extension method in InputControlExtensions
).InputControl.ReadValueFromBufferAsObject
. This allows reading a value stored in memory without having to know the value type.ScaleProcessor
ScaleVector2Processor
ScaleVector3Processor
InvertVector2Processor
InvertVector3Processor
NormalizeVector2Processor
NormalizeVector3Processor
MultiTapInteraction
. Can be used to listen for double-taps and the like.InputMetrics.totalEventLagTime
and InputMetrics.averageEventLagTime
.Mouse.forwardButton
and Mouse.backButton
.Pen
.InputAction.CallbackContext.ReadValueAsObject()
.
InputParameterEditor
. This solves the problem of these elements not making it clear that the parameters usually have global defaults and do not need to be edited except if local overrides are necessary.Can now set custom min and max values for axis composites.
var action = new InputAction();
action.AddCompositeBinding("Axis(minValue=0,maxValue=2)")
.With("Positive", "<Keyboard>/a")
.With("Negative", "<Keyboard>/d");
"C# Class File" property on .inputactions importer settings now has a file picker next to it.
InputActionTrace
has seen various improvements.
InputActionTrace.SubscribeToAll
.InputActionTrace
now maintains a list of subscriptions. Add subscriptions with SubscribeTo
and remove a subscription with UnsubscribeFrom
. See the documentation for details.InputUser.UnpairDevicesAndRemoveUser()
corrupting device pairings of other InputUsersIndexOutOfRangeException
when having multiple action maps in an asset (#359 and #358).Pen
causing exceptions and asserts.NOTE: The minimum version requirement for the new input system has been bumped
to 2018.3. The previous minum requirement of 2018.2 is no longer supported.
Also, we have dropped support for the .NET 3.5 runtime. The new .NET 4
runtime is now required to use the new input system.
We've started working on documentation. The current work-in-progress can be found on GitHub.
InputConfiguration
has been replaced with a new InputSettings
class.InputConfiguration.lockInputToGame
has been moved to InputEditorUserSettings.lockInputToGameView
. This setting is now persisted as a local user setting.InputSystem.updateMask
has been replaced with InputSettings.updateMode
.InputSystem.runInBackground
has been moved to InputSettings.runInBackground
.Lock Input To Game
and Diagnostics Mode
are now persisted as user settings.current
getters and added InputSettings.filterNoiseOnCurrent
to control whether noise filtering on the getters is performed or not.InputSystem.settings
contains the current input system settings.Assets/
. Multiple assets can be used and switched between.InputSettings.updateMode
). In this mode, events will not get automatically processed. To process events, call InputSystem.Update()
.InputSystem.devices
not yet being initialized in MonoBehaviour.Start
when in editor.Pointer.delta
no longer has SensitivityProcessor
on it. The processor was causing many issues with mouse deltas. It is still available for adding it manually to action bindings but the processor likely needs additional work.Core:
Actions:
Misc:
First release from stable branch.