Changelog
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.
[1.2.0] - 2021-10-22
Changed
- When exceptions occur in user code inside of Input System callbacks, the exception message is now printed first and details about the callback second.
- Previously a message similar to "Exception ... while executing '...' callbacks" was printed first and then followed by exception log. This was hiding the actual exception and created confusion.
Fixed
- Fixed a performance issue on entering/exiting playmode where HID device capabilities JSON could be parsed multiple times for a single device(case 1362733).
- Fixed a problem where explicitly switching to the already active control scheme and device set for PlayerInput would cancel event callbacks for no reason when the control scheme switch would have no practical effect. This fix detects and skips device unpairing and re-pairing if the switch is detected to not be a change to scheme or devices. (case 1342297)
- Any unhandled exception in
InputManager.OnUpdatefailing latter updates withInvalidOperationException: Already have an event buffer set! Was OnUpdate() called recursively?. Instead the system will try to handle the exception and recover into a working state. - Fixed an issue that broke the
VirtualMouseInputcomponent in the editor (case 1367553). - Fixed a problem where only using runtimes that are not XR supported causes a compile error.This fix adds back in ENABLE_VR checks to prevent this case (case 1368300)
- Fixed input action for Android gamepad's right stick will be correctly invoked when only y axis is changing (case 1308637).
- Generic gamepad short display button names where incorrectly mapped on Switch (
Ainstead ofB, etc). - Fixed an issue where resetting an action via
InputAction.Reset()while being in disabled state would prevent the action from being enabled again. (case 1370732). - Fixed "Default constructor not found for type UnityEngine.InputSystem.iOS.LowLevel.iOSStepCounter" any other potential exceptions due to classes, methods, fields and properties being stripped when managed stripping setting set to medium or high (case 1368761).
- Fixed an issue where InvalidOperationExceptions are thrown if an input for an action with multiple interactions is held while disconnecting the device(case 1354098).
- Fixed
action.ReadValueand others returning invalid data when used fromFixedUpdateor early update when running in play mode in the editor (case 1368559 case 1367556 case 1372830). - Fixed current being
nullfor sensors (Accelerometer.current, others) (case 1371204).
Added
- Added support for PS5 DualSense controllers on Mac and Windows.
- Improved the user experience when creating single vs multi-touch touchscreen bindings in the Input Action Asset editor by making both options visible in the input action dropdown menu. Now it's not neccessary to be aware of the touch*/press path binding syntax (case 1357664).
[1.1.1] - 2021-09-03
Fixed
- Fixed
InvalidCastException: Specified cast is not valid.andInvalidOperationException: Already have an event buffer set! Was OnUpdate() called recursively?when upgrading from 1.1.0-pre.5 or earlier. If you experience this issue you can also restart the editor to resolve it. - Fixed
InputDeviceChange.Destroyednot being available, now it's correctly marked as obsolete instead. - Removed documentation around platform user account management of
InputUserwhich was ahead of actual backend support for the feature.
[1.1.0] - 2021-08-27
Changed
- Modified the fix that landed in
1.1-preview.3for any given control being added to an action only once.- This caused a regression with some setups that, for example, bound the same control multiple times in a composite using processors to alter the value of the control.
- Internally, a control is now again allowed to feed into the same action through more than one binding.
- However, externally the control will be mentioned on the action's
InputAction.controlslist only once.
- Adding
InputSystemUIInputModulefrom code now installsDefaultInputActions. This is equivalent to the default setup when adding the component in the editor (case 1259306).CSharp var go = new GameObject(); go.AddComponent<EventSystem>(); var uiModule = go.AddComponent<InputSystemUIInputModule>(); // uiModule.actionsAsset now has a DefaultInputActions() asset assigned to it and the various // action references point to its actions.InputSystemUIInputModule.UnassignActionshas been added to remove all actions from the module en bloc.CSharp uiModule.UnassignActions();
Fixed
- Fixed an issue where mixing test cases based on
InputTestFixture(using mockedInputSystem) and regular test cases (using realInputSystem) would lead to static state leaking between test cases causing random failures and unexpected/undefined behavior (case 1329015). - Fixed
InputSystemUIInputModule.AssignDefaultActionsnot assigningtrackedDeviceOrientationandtrackedDevicePosition. - Fixed regression introduced by previous change where
InputSystemUIInputModulewould not disable actions correctly. - Fixed
InputAction.cancelednot getting triggered reliably forInputActionType.PassThroughactions whenInputSystem.ResetDevicewas called. - Fixed device resets (e.g. happening as part of focus changes) leading to only some actions bound to these devices getting cancelled instead of all of them.
[1.1.0-pre.6] - 2021-08-23
Fixed
- Fixed pairing devices to existing
InputUsers potentially corrupting list of paired devices from otherInputUsers (case 1327628). - Fixed duplication of control paths when viewing collections of
InputControls in the inspector.- Fix contributed by NibbleByte in 1354.
- Fixed
StackOverflowExceptioncaused by callingInputSystem.Updatefrom inside an input action callback such asInputAction.performed(case 1316000). - Fixed
InputTestFixtureleaving all.currentgetters uninitialized after a test run (case 1329015). - Fixed broken script references in Touch Samples project (case 1190598).
- Fixed
PointerInputcomposite inTouchSamplesproject being registered only after scenes already loaded (case 1215048). - Fixed
InputControlExtensions.EnumerateChangedControlsskipping overleft,right, anddowncontrols on PS4 controller's dpad (case 1315107). - Fixed undo not working in
Input System Packageproject settings pane (case 1291709). - Fixed incorrect indexing in
InputUser.OnDeviceChangedthat could result in incorrect pairing of devices orIndexOutOfRangeExceptionbeing thrown when removing, adding or reconfiguring a device. Fix contribution by Mikael Klages in #1359. - Fixed incorrect indexing when sorting magnitude based on score in
InputActionRebindingExtensions.RebindingOperationwhich could result in incorrect magnitudes for candidates. Contribution by Fredrik Ludvigsen in #1348. - Fixed inconsistent ordering and execution when adding to or removing from the various callbacks in the API (such as
InputSystem.onDeviceChangebut alsoInputAction.startedetc.) during the execution of a callback (case 1322530. - Fixed inconsistent behavior of WebGL gamepad left/right stick. Up/Down controls were reverse of X/Y controls. (case 1348959)
- Fixed
PlayerInputManagers join action not triggering when using a referencedInputAction(case 1260625). - Fixed UI issue where pressing the wrong button was possible while quickly moving through a UI because the submit action fired on action press instead of action release (1333563).
- Fixed InvalidOperationException when opening a preset created from a .inputactions asset (case 1199544).
- Fixed a problem arising when combining InputSystemUIInputModule and PlayInput with SendMessage or BroadcastMessage callback behavior on the same game object or hierarchy which is an ambiguous input setup. This fix eliminates callbacks into InputSystemUIInputModule. Related to (1343712).
- Fixed inconsistent usage of
ENABLE_PROFILERdefine together withProfiler.BeginSample/Profiler.EndSampleby removingENABLE_PROFILERmacro check becauseBeginSample/EndSampleare already conditional with[Conditional("ENABLE_PROFILER")](case 1350139). - Remediated majority of performance issues with high frequency mice (>=1kHz poll rates) in release mode by merging consecutive mouse move events together (case 1281266), see the events documentation for more information.
- Fixed
InputEventTracereplays skipping over empty frames and thus causing playback to happen too fast. - Fixed
"Pointer should have exited all objects before being removed"error when changing screen orientation on mobile. - Controls such as mouse positions are no longer reset when focus is lost.
- Pressing a uGUI
Buttonand then alt-tabbing away, letting go of the button, and then going back to the application will no longer trigger a button click. - Fixed
Input.onUnpairedDeviceActivitytriggering from editor input. - Fixed 'up' and 'down' controls on
WebGLGamepadleft and right sticks not being clamped correctly.
Actions
- Fixed right-clicking in empty action map or action list not popping up context menu (case 1336426).
- Fixed binding paths being misaligned in UI when switching to text mode editing (case 1200107).
- Fixed
"Exception: Style.Draw may not be called with GUIContent that is null."error fromPlayerInputinspector when having an action map with no actions (case 1317735). - Fixed calling
GetBindingDisplayString()on anInputActionwith a composite binding leading to doubled up output (case 1321175). - Fixed
MultiTapInteractionnot respectingInputSettings.multiTapDelayTime(case 1292754). - Fixed changing values in
Input System Packageproject settings not affecting default values displayed in.inputactionseditor window (case 1292754). - Fixed rebinding a part of a composite with
RebindingOperation.WithTargetBindingnot also changing the type of control being looked for (case 1272563). - Fixed
AxisCompositenot respectingminValueandmaxValueproperties (case 1335838). - Fixed
ArgumentOutOfRangeExceptioncaused byIsPointerOverGameObject(case 1337354). PlayerInputno longer logs an error message when it is set toInvoke UnityEventsand can't find an action in the given.inputactionsasset (case 1259577).- Fixed
HoldInteractiongetting stuck when hold and release happens in same event (case 1346786). - Fixed adding an action in the
.inputactionseditor automatically duplicating interactions and processors from the first action in the map. - Fixed
InputActionSetupExtensions.ChangeBindingwhen modifying binding from a different action than specified. Contribution by Fredrik Ludvigsen in #1348. - Fixed right stick and trigger controls on gamepads not receiving proper input on Android.
Added
- Added
InputSystem.runUpdatesInEditModeto enable processing of non-editor updates without entering playmode (only available for XR). - Added a new "UI vs Game Input" sample to the package. The sample can be installed from the Unity Package Manager UI in the editor.
- The sample demonstrates how to deal with inputs that may both lead to UI actions as well as in-game actions.
- Added method
SetMotorSpeedsAndLightBarColoras a workaround for setting both the light bar and motor speeds simultaneously on a DualShock 4 controller (case 1271119). - Added the concept of "soft" and "hard" device resets.
- In general, resetting a device will reset its state to default values.
- Individual controls can be marked as
dontResetto exclude them from resets. This makes the reset "soft" (default).CSharp // Perform a "soft" reset of the mouse. The mouse position will not be affected // but controls such as buttons will be reset. InputSystem.ResetDevice(Mouse.current); - A "hard" reset can be forced through the API. This also resets
dontResetcontrols.CSharp // Perform a "hard" reset of the mouse. The mouse position will also be reset to (0,0). InputSystem.ResetDevice(Mouse.current, alsoResetDontResetControls: true); - Resets will lead to
InputActions that are enabled and in-progress from controls that being reset, to be canceled. This will not perform actions even if they trigger on, for example, button release.
InputDevice.canRunInBackgroundcan now be force-set through layouts.CSharp // Force XInputWindows gamepads to not run in the background. InputSystem.RegisterLayoutOverride(@" { ""name"": ""XInputWindowsNoCanRunInBackground"", ""extend"": ""XInputWindows"", ""runInBackground"": ""off"" } ");- Improved performance of
Touchscreenby merging consecutive touch move events together. See the events documentation for more information.
Actions
- Added a new
InputAction.wantsInitialStateCheckproperty that allows toggling on initial state checks forButtonandPass-Throughactions (implicitly enabled forValueactions).- This allows responding immediately to controls that are already actuated when the action is enabled.
- Added new API for more easily listening for event changes.
CSharp InputSystem.onEvent .ForDevice<Gamepad>() .Where(e => e.HasButtonPress()) .CallOnce(e => Debug.Log("Button pressed!)); - Added new API to easily listen for button presses on any device.
CSharp InputSystem.onAnyButtonPress .CallOnce(ctrl => Debug.Log($"Button '{ctrl}' pressed"));- This is a simple wrapper around the new API mentioned above.
Changed
- Application focus handling behavior has been reworked.
- When
runInBackgroundis off, no action will be taken on focus loss. When focus comes back, all devices will receive a sync request. Those that don't support it will see a "soft" reset. - When
runInBackgroundis on (which, when running in the editor, is considered to always be the case), a new settingInputSettings.backgroundBehaviordictates how input is to be handled while the application does not have focus. The default setting ofResetAndDisableNonBackgroundDeviceswill soft-reset and disable all devices for whichInputDevice.canRunInBackgroundis false. While in the background, devices that are flagged ascanRunInBackgroundwill keep running as in the foreground. - In the editor, devices other than
PointerandKeyboarddevices (i.e. anything not used to operate the editor UI) are now by default routing their input to the Game View regardless of focus. This also fixes the problem of gamepad sticks resetting to(0,0)on focus loss (case 1222305). - A new setting
InputSettings.gameViewFocushas been introduced to determine how Game View focused is handled in the editor with respect to input.
- When
- Editor: Removed 'Lock Input to Game View' setting in the Input Debugger.
- The setting has been replaced by the new 'Game View Focus' project setting.
InputSystem.defaultButtonPressPointis now clamped to a minimum value of0.0001(case 1349002).InputDevice.OnConfigurationChangedcan now be overridden in derived classes.InputSystemUIInputModulenow defers removing pointers for touches by one frame.- This is to ensure that
IsPointerOverGameObjectcan meaningfully be queried for touches that have happened within the frame – even if by the time the method is called, a touch has technically already ended (case 1347048). - More precisely, this means that whereas before a
PointerExitandPointerUpwas received in the same frame, a touch will now see aPointerUpin the frame of release but only see aPointerExitin the subsequent frame.
- This is to ensure that
- Calling
EventSystem.IsPointerOverGameObject()from withinInputActioncallbacks (such asInputAction.performed) will now result in a warning.- UI updates after input and consumes input through
InputActions as they are processed. Thus, querying UI state from withinInputActioncallbacks will query outdated UI state.
- UI updates after input and consumes input through
- Changed
TrackedPoseDriverto use properties of typeInputActionPropertyrather thanInputActionto allow more flexibility. - Changed quickstart documentation sample to use the Update method instead of FixedUpdate to show a more correct usage of the
wasPressedThisFrameAPI. - PS4 and Xbox controllers on Android are now based on
DualShockGamepadandXInputControllerrespectively instead of the genericAndroidGamepad.
[1.1.0-pre.5] - 2021-05-11
- Fixes a problem with the package's manifest missing a dependency on the UI Elements module.
[1.1.0-pre.4] - 2021-05-04
Changed
- The
VirtualMouseInputcomponent is now part of the Input System assembly. It was previously packaged with theGamepad Mouse Cursorsample.- The component has a different GUID from before, so existing setups that use the component from the sample are not broken. To use the built-in component you must explicitly switch over.
InputTestFixtureno longer deletes theGameObjects in the current scene in itsTearDown(case 1286987).- This was added for the sake of the Input System's own tests but should not have been in the public fixture.
- Generic
Gamepadnow has platform independent long button names. Previously it used different names if editor targeted PS4/Switch consoles (case 1321676). - When creating a new control scheme with a name
All Control Schemes,All Control Schemes1will be created to avoid confusion with implicitAll Control Schemesscheme (case 1217379). - Display names of keyboard buttons are now passed through
ToLowerandToTitleCaseto enforce consistent casing between different platforms and keyboard layouts (case 1254705). - Editor: All remaining
InputUserinstances are now removed automatically when exiting play mode. This means that all devices are automatically unpaired.- In essence, like
InputAction,InputUseris now considered a player-only feature.
- In essence, like
- Events queued during event processing (i.e.
InputSystem.Update()) are now processed in the same frame. This eliminates the 1-frame lag previously incurred by simulated input.- Note that this does not extend to input queued outside of event processing but in the same frame. For example, input queued by the UI (such as by
OnScreenButtonandOnScreenStick) will still see a 1-frame lag as UI event processing happens later in the frame and outside of input event processing.
- Note that this does not extend to input queued outside of event processing but in the same frame. For example, input queued by the UI (such as by
Actions
- When removing/unplugging a device, it will now also be removed from the device list of
InputActionMap.devicesandInputActionAsset.devices.CSharp var gamepad = InputSystem.AddDevice<Gamepad>(); var actions = new MyGeneratedActions(); actions.devices = new[] { gamepad }; InputSystem.RemoveDevice(gamepad); // `actions.devices` is now an empty array. - Adding an action to a
InputActionMapthat is part of anInputActionAssetnow requires all actions in the asset to be disabled (case 1288335).- This used to trigger an
Assertat runtime but now properly throws anInvalidOperationException.
- This used to trigger an
Fixed
- Fixed inputs in game view sometimes not working when running in the editor, as initial focus state could end up being incorrect.
- Fixed bad performance in Input Debugger with high-frequency devices (e.g. 1+ KHz gaming mice). Before, high event volumes led to excessive refreshes of debugger data.
- Fixed compile error on tvOS due to step counter support for iOS added in
1.1.0-preview.3. - Fixed PS4- and PS3-specific
rightTriggerButtonandleftTriggerButtoncontrols not being marked as synthetic and thus conflicting withrightTriggerandleftTriggerinput (case 1293734).- This manifested itself, for example, when using interactive rebinding and seeing
rightTriggerButtongetting picked instead of the expectedrightTriggercontrol.
- This manifested itself, for example, when using interactive rebinding and seeing
- Fixed changes to usages of devices in remote player not being reflected in Input Debugger.
- Fixed exceptions and incorrect values with HIDs using 32-bit fields (case 1189859).
- This happened, for example, with vJoy installed.
- Fixed
InputUserno longer sendingInputUserChange.ControlsChangedwhen adding a new user after previously, all users were removed.- Fix contributed by Sven Herrmann in 1292.
- Fixed
AxisDeadzoneProcessormin/max values not being settable to 0 in editor UI (case 1293744). - Fixed blurry icons in input debugger, asset editor, input settings (case 1299595).
- Fixed
clickCountnot being incremented correctly byInputSystemUIInputModulefor successive mouse clicks (case 1317239). - Fixed UI not working after additively loading scenes with additional InputSystemUIInputModule modules (case 1251720).
- Fixed no
OnPointerExitreceived when changing UI state without moving pointer (case 1232705). - Fixed reference to
.inputactionsofPlayer Prefabreferenced byPlayerInputManagerbeing destroyed on going into play mode, if the player prefab was a nested prefab (case 1319756). - Fixed "Scheme Name" label clipped in "Add Control Schema" popup window ([case 1199560]https://issuetracker.unity3d.com/issues/themes-input-system-scheme-name-is-clipped-in-add-control-schema-window-with-inter-default-font)).
- Fixed
InputSystem.QueueEventcalls from withinInputActioncallbacks getting dropped entirely (case 1297339). - Fixed
InputSystemUIInputModulebeing in invalid state when added fromAwaketo a game object when entering playmode (case 1323566). - Fixed
Keyboard.currentbecomingnullafterOnScreenButtonis disabled or destroyed (case 1305016).
Actions
- Fixed rebinding not working for any discrete control that was held when the rebinding operation started (case 1317225).
- Fixed bindings being added to every InputAction in a collection when editing a collection of InputActions in the inspector. (case 1258578)
- Fixed
Retrieving array element that was out of boundsandSerializedProperty ... has disappeared!errors when deleting multiple action bindings in the input asset editor (case 1300506). - Fixed delete key not working in the input actions editor (case 1282090).
- Fixed actions embedded into
MonoBehavioursnot showing bindings added directly from within constructors (case 1291334).CSharp public class MyMB : MonoBehaviour { // This would end up not showing the binding in the inspector. public InputAction action = new InputAction(binding: "<Gamepad>/leftStick"); - Fixed tooltips not appearing for elements of the Input Actions editor window (case 1311595).
- Fixed
NullReferenceExceptionwhen reading values throughInputAction.CallbackContexton aOneModifierCompositeorTwoModifierCompositebinding. - Fixed multi-taps not working when multiple controls were bound to an action (case 1267805).
- When there were multiple controls bound to an action, this bug would get triggered by any interaction that did not result in a phase change on the action.
- Fixed runtime rebinds added as new bindings from leaking into .inputactions assets when exiting play mode (case 1190502)
- Fixed
IndexOutOfRangeExceptionandnullelements inInputUser.lostDeviceswhen anInputUserloses a devices from a control scheme with only optional devices (case 1275148). - Fixed binding path selection windows not remembering navigation state when going up through hierarchy (case 1254981).
Added
- Support for Device Simulator touchscreen input.
- Enabled XR device support on Magic Leap (Lumin).
- Added ability to force XR Support in a project by defining
UNITY_INPUT_FORCE_XR_PLUGIN. - Added a warning message to PlayerInputManager editor when the attached input action asset won't work with Join Players When Button Is Pressed behaviour due to missing control scheme device requirements (case 1265853).
- Added support for UI Toolkit with Unity 2021.1+.
- UITK is now supported as a UI solution in players. Input support for both Unity UI and UI Toolkit is based on the same
InputSystemUIInputModulecode path. More details in the manual.
- UITK is now supported as a UI solution in players. Input support for both Unity UI and UI Toolkit is based on the same
InputSystemUIInputModulenow has anxrTrackingOriginproperty. When assigned, this will transform all tracked device positions and rotations from it's local space into Unity's world space (case 1308480).- Added
InputSystemUIInputModule.GetLastRaycastResult. This returns the most recent raycast result and can be used to draw ray visualizations or get information on the most recent UI object hit. - Added
InputStateBlocksupport forkFormatSBitwhen working with floats (case 1258003). Added an API to parse control paths.
var parsed = InputControlPath.Parse("<XRController>{LeftHand}/trigger").ToArray(); Debug.Log(parsed.Length); // Prints 2. Debug.Log(parsed[0].layout); // Prints "XRController". Debug.Log(parsed[0].name); // Prints an empty string. Debug.Log(parsed[0].usages.First()); // Prints "LeftHand". Debug.Log(parsed[1].layout); // Prints null. Debug.Log(parsed[1].name); // Prints "trigger".- Can, for example, be used with
InputBinding.path.
- Can, for example, be used with
- Added a new API-only setting in the form of
InputSystem.settings.maxEventBytesPerUpdate.- Puts an upper limit on the number of event bytes processed in a single update.
- If exceeded, any additional event data will get thrown away and an error will be issued.
- Set to 5MB by default.
- Added a new API-only setting called
InputSystem.settings.maxQueuedEventsPerUpdate.- This limits the number of events that can be queued during event processing using the
InputSystem.QueueEventmethod. This guards against infinite loops in the case where an action callback queues an event that causes the same action callback to be called again.
- This limits the number of events that can be queued during event processing using the
- Added
InputSystemUIInputModule.AssignDefaultActionsto assign default actions when creating ui module in runtime. - Added
UNITY_INCLUDE_TESTSdefine constraints to our test assemblies, which is 2019.2+ equivalent to"optionalUnityReferences": ["TestAssemblies"].
[1.1.0-preview.3] - 2021-02-04
Changed
- An upper limit of 1024 controls per device and 1kb of memory state per device has been introduced.
- This allows for certain optimizations.
- Should the limits prove too tight, they can be raised in the future.
- The most complex device we have at the moment (
Touchscreen) has 242 controls and 616 bytes of state.
TouchSimulationnow disables thePointerdevices it reads input from.- This is to address the problem of mouse input leading to both mouse and touch input happening concurrently. Instead, enabling touch simulation will now effectively replace mouse and pen input with touch input.
- Devices such
MouseandPenwill remain in place but will not get updated. Events received for them will be consumed byTouchSimulation.
- Enabled XR device support on Switch.
Fixed
- Fixed precompiled layouts such as
FastKeyboardleading to build time regressions with il2cpp (case 1283676). - Fixed
InputDevice.canRunInBackgroundnot being correctly set for VR devices (thus not allowing them to receive input while the application is not focused). - Fixed
InputUser.OnEventandRebindingOperation.OnEventexhibiting bad performance profiles and leading to multi-millisecond input update times (case 1253371).- In our own measurements,
InputUser.OnEventis >9 times faster than before andRebindingOperation.OnEventis ~2.5 times faster.
- In our own measurements,
- Fixed PS4 controller not recognized on Mac when connected over Bluetooth (case 1286449).
- Fixed
EnhancedTouchleakingNativeArraymemory on domain reloads (case 1190150). - Fixed
TouchSimulationleading to"Pointer should have exited all objects before being removed"errors (case 1190150). - Fixed multi-touch not working with
InputSystemUIInputModule(case 1271942).- This also manifested itself when using On-Screen Controls and not being able to use multiple controls at the same time (for example, in the Warriors demo).
- Fixed restart prompt after package installation not appearing on Unity 2020.2+ (case 1292513).
- Fixed action with multiple bindings getting stuck in
Performedstate when two or more controls are pressed at the same time (case 1295535).- Regression introduced in 1.1-preview.2.
- Fixed
Touch.activeToucheshaving incorrect touch phases after callingEnhancedTouch.Disable()and thenEnhancedTouch.Enable()(case 1286865). - Fixed compile errors related to XR/AR on console platforms.
Actions
- Fixed actions not triggering correctly when multiple bindings on the same action were referencing the same control (case 1293808).
- Bindings will now "claim" controls during resolution. If several bindings on the same action resolve to the same control, only the first such binding will successfully resolve to the control. Subsequent bindings will only resolve to controls not already referenced by other bindings on the action.
CSharp var action = new InputAction(); action.AddBinding("<Gamepad>/buttonSouth"); action.AddBinding("<Gamepad>/buttonSouth"); // Will be ignored. action.AddBinding("<Gamepad>/button*"); // Will only receive buttonWest, buttonEast, and buttonNorth. - This also means that
InputAction.controlswill now only contain any control at most once.
- Bindings will now "claim" controls during resolution. If several bindings on the same action resolve to the same control, only the first such binding will successfully resolve to the control. Subsequent bindings will only resolve to controls not already referenced by other bindings on the action.
- Fixed JSON serialization of action maps not preserving empty binding paths (case 1231968).
Added
Added a new high-performance way to iterate over changed controls in an event.
// Can optionally specify a magnitude threshold that controls must cross. // NOTE: This will note allocate GC memory. foreach (var control in eventPtr.EnumerateChangedControls(magnitudeThreshold: 0.1f)) Debug.Log($"Control {control} changed state");This can be used, for example, to implement much more performant "any button pressed?" queries.
InputSystem.onEvent += (eventPtr, device) => { // Ignore anything that is not a state event. var eventType = eventPtr.type; if (eventType != StateEvent.Type && eventType != DeltaStateEvent.Type) return; // Find all changed controls actuated above the button press threshold. foreach (var control in eventPtr.EnumerateChangedControls (device: device, magnitudeThreshold: InputSystem.settings.defaultButtonPressThreshold)) // Check if it's a button. if (control is ButtonControl button) Debug.Log($"Button {button} was pressed"); }
- Added support for Step Counter sensors for iOS.
- You need to enable Motion Usage under Input System settings before using the sensor. You can also manually add Privacy - Motion Usage Description to your application's Info.plist file.
[1.1.0-preview.2] - 2020-10-23
Changed
- The
submitand thecancelactions of the UI input module now trigger on release instead of press. This makes the behavior consistent with clicks triggering UI response on release rather than press. - Removed the old "Tanks" demo (previously available from the samples shipped with the package).
- Added a new and improved demo project, which you can download from the InputSystem_Warriors GitHub repository.
Actions
- Actions of type
InputActionType.Buttonnow respect button press (and release) points.- Previously, button-type actions, when used without explicit "Press" interactions, would perform immediately when a bound control was actuated.
- Now, a button-type action will behave the same as if a "Press" interaction is applied with "Trigger Behavior" set to "Press Only".
- This means that a button-type action will now perform (and perform once only) when a control crosses the button press threshold defined in the global settings or, if present, locally on a
ButtonControl. It will then stay performed and finally cancel only when the control falls back to or below the release threshold.
InputAction.ReadValue<T>()now always returnsdefault<T>when the action is canceled.- This is to make it consistent with
InputAction.CallbackContext.ReadValue<T>()which already returneddefault<T>when the action was canceled. - In general, all APIs that read values will return default values when an action is in a phase other than
StartedorPerformed.
- This is to make it consistent with
If multiple actions in different action maps but in the same .inputactions asset have the same name, calling
InputActionAsset.FindAction()with just an action name will now return the first enabled action. If none of the actions are enabled, it will return the first action with a matching name as before (case 1207550).var map1 = new InputActionMap("map1"); var map2 = new InputActionMap("map2"); map1.AddAction("actionWithSameName"); map2.AddAction("actionWithSameName"); var asset = ScriptableObject.CreateInstance<InputActionAsset>(); asset.AddActionMap(map1); asset.AddActionMap(map2); map2["actionWithSameName"].Enable(); var action = asset["actionWithSameName"]; // Before: "map1/actionWithSameName" // Now: "map2/actionWithSameName"
Fixed
- Fixed player build causing
ProjectSettings.assetto be checked out in Perforce (case 1254502). - Fixed player build corrupting preloaded asset list in
PlayerSettingsif it was modified by another build processor. - Fixed remoting in Input Debugger not working for devices in the player that are created from generated layouts (such as XR devices).
- Fixed potential
NullReferenceExceptioninInputActionPropertywhen theInputActionReferenceisnull. - Fixed "On-Screen Controls" sample still using
StandaloneInputModuleand thus throwingInvalidOperationExceptionwhen used with "Active Input Handling" set to "Input System Package (New)" (case 1201866). - Fixed
OnScreenButtonleaving button controls in pressed state when disabled in-between receivingOnPointerDownandOnPointerUp. Usually manifested itself by having to click the button twice next time it was enabled. - Fixed exiting out of play mode in the Unity Editor while a test run is in progress leading to the Input System permanently losing all its state until the editor is restarted (case 1251724).
- Fixed max values for
AxisandDoublecontrols stored as multi-bit fields being off by one (case 1223436). - Fixed debug assert in
InputDeviceTestersample when simultaneously pressing two buttons on gamepad (case 1244988). - Fixed use of UI
Slidercausing drag thresholds to no longer work (case 1275834). - Fixed layout lists in Input Debugger not updating when removing layouts.
- Fixed device connects leading to different but similar device being reported as reconnected.
Actions
- Fixed Action with multiple bindings becoming unresponsive after a Hold interaction was performed (case 1239551).
- Fixed
NullReferenceExceptionwhenPlayer InputcomponentCreate Actionis pressed and saved (case 1245921). - Fixed
InputActionTrace.ActionEventPtr.ReadValueAsObjectleading toInvalidCastExceptionwhen trying to read values that came from composite bindings. - Fixed not being able to stack a
MultiTapon top of aTap(case 1261462). - Fixed rebinds triggered by the Enter key causing stuck Enter key states (case 1271591).
- Fixed
Map index on triggerandIndexOutOfRangeExceptionerrors when using multiple Interactions on the same Action. (case 1253034). - Fixed context menu in action editor not filtering out composites the same way that the
+icon menu does. This led to, for example, a "2D Vector" composite being shown as an option for a button type action. - Fixed initial state checks for composite bindings failing if performed repeatedly. For example, doing a
ReadValue<Vector2>for a WASD binding would return an incorrect value after disabling the map twice while no input from the keyboard was received (case 1274977). - Fixed "Add Interaction" menu in action editor not filtering out interactions with incompatible value types (case 1272772).
- Fixed
PlayerInputno longer auto-switching control schemes ifneverAutoSwitchControlSchemeswas toggled off and back on after the component was first enabled (case 1232039). - Fixed action map name being the same as .inputactions asset name leading to compile errors when
Generate C# Classis used; now leads to import error (case 1212052). - Fixed bindings not getting updated when binding by display name and there is no control with the given display name initially.
// If at the time this action is enabled, there's no ä key on the keyboard, // this did not update properly later when switched to a layout that does have the key. var action = new InputAction(binding: "<Keyboard>/#(ä)");
Added
- Added tvOS documentation entries in 'Supported Input Devices' page.
Actions
- Added "release thresholds" for buttons.
- Release points are now separated from press points by a percentage threshold.
- The threshold is defined by
InputSettings.buttonReleaseThreshold. - Thresholds are defined as percentages of press points. A release is thus defined as a button, after having reached a value of at least
InputSettings.defaultButtonPressPoint(or whatever local press is used), falling back to a value equal to or less thanInputSettings.buttonReleaseThresholdpercent of the press point. - This is intended to solve the problem of buttons flickering around button press points.
- The default threshold is set at 75%, that is, buttons release at 3/4 of the press point.
- Added new methods to the
InputActionclass:InputAction.IsPressed(): Whether a bound control has crossed the press threshold and has not yet fallen back below the release threshold.InputAction.WasPressedThisFrame(): Whether a bound control has crossed the press threshold this frame.InputAction.WasReleasedThisFrame(): Whether a bound control has fallen back below the release threshold this frame.InputAction.WasPerformedThisFrame(): Whether the action was performed at any point during the current frame. Equivalent toInputAction.triggered, which will be deprecated in the future.InputAction.Reset(): Forcibly reset the action state. Cancels the action, if it is currently in progress.
- Added
InputAction.GetTimeoutCompletionPercentageto query the amount left to complete a currently ongoing interaction.CSharp // Let's say there's a hold interaction on a "warp" action. The user presses a button bound // to the action and then holds it. While the user holds the button, we want to know how much // longer the user will have to hold it so that we can display feedback in the UI. var holdCompleted = playerInput.actions["warp"].GetTimeoutCompletionPercentage(); - Added three new binding composite types:
OneModifierComposite: This is a generalization ofButtonWithOneModifier(which is still available but now hidden from the UI) which also represents bindings such as "SHIFT+1" but now can be used to target bindings other than buttons (e.g. "SHIFT+delta").TwoModifiersComposite: This is a generalization ofButtonWithTwoModifiers(which is still available but now hidden from the UI) which also represents bindings such as "SHIFT+CTRL+1" but now can be used to target bindings other than buttons (e.g. "SHIFT+CTRL+delta").Vector3Composite: Works the same wayVector2Compositedoes. Adds aforwardandbackwardbinding in addition toup,down,left, andright.
[1.1.0-preview.1] - 2020-08-20
The minimum version requirement for the Input System package has been moved up to 2019.4 LTS.
Changed
Actions
- Auto-generated C# files now have
<auto-generated>headers so they get ignored by Rider code analysis. - Auto-generated C# classes are now
partialso that they can be manually extended. - Deleting a composite binding with
action.ChangeBinding(0).Erase()now also erases all the bindings that are part of the composite. - Trigger binding resolution from within action callbacks (e.g.
InputAction.performed) will now defer resolution until after the callback has completed.- This fixes crashes such as case 1242406 where disabling
PlayerInputfrom within an action callback led to an action's state being released while the action was still in a callback.
- This fixes crashes such as case 1242406 where disabling
Fixed
- Fixed input history on Android mono build by alligning memory of history records
- Fixed no input being processed when running a
[UnityTest]over several frames. Before, this required callingInputSystem.Updatemanually. - Fixed clicking on help page button in Unity inspector for Input System components not going to relevant manual pages.
- Fixed a bug that prevented DualShock controllers from working on tvOS. (case 1221223).
GravitySensor,LinearAccelerationSensor, andAttitudeSensornot being initialized on iOS (case 1251382).- Fixed compilation issues with XR and VR references when building to platforms that do not have complete XR and VR implementations.
- Fixed possible
NullReferenceExceptions on ARMs with controls that receive automatic memory offsets. - Fixed
TouchControl.tapCountresetting to 0 when "Script Debugging" is enabled (case 1194636). - Fixed
Touch.activeTouchesnot having aTouchPhase.Beganentry for touches that moved in the same frame that they began in (case 1230656). - Fixed sequential taps causing touches to get stuck in
Touch.activeTouches. - Improved performance of
Touch.activeTouches(most notably, a lot of time was spent in endlessly repetitive safety checks). - Fixed
EnhancedTouchAPIs not indicating that they need to be enabled withEnhancedTouchSupport.Enable().- The APIs now throw
InvalidOperationExceptionwhen used without being enabled.
- The APIs now throw
- Fixed memory corruption in
InputEventTrace.AllocateEvent(case 1262496)- Manifested itself, for example, as crashes when using
InputActionTrace.SubscribeToAll.
- Manifested itself, for example, as crashes when using
- AxisControls and Vector2Controls' X and Y subcontrols on XR devices now have a minimum range of -1 and a maximum range of 1. This means they can now properly respond to modifiers and interactions in the binding system.
Actions
- Fixed drag&drop reordering actions while having one control scheme selected causing bindings from other control schemes to be lost (case 122800).
- Fixed stack overflow in
PlayerInput.SwitchCurrentActionMapwhen called from action callback (case 1232893). - Fixed control picker ending up empty when listing devices in "Supported Devices" (case 1254150).
Added
- Device layouts can now be "precompiled" for speed.
Keyboard,Mouse, andTouchscreenare now included as precompiled layouts greatly reducing instantiation time and GC heap cost for these devices. ForTouchscreen, this results in a >20x speed-up forInputSystem.AddDevice<Touchscreen>(). - Added Pose Control layout. The Pose Control is used on XR Devices and wraps tracking state, position, rotation, and velocity information.
Actions
Can now save binding overrides as JSON strings and restore them from such using the newly added
SaveBindingOverridesAsJsonandLoadBindingOverridesFromJsonextension methods.void SaveUserRebinds(PlayerInput player) { var rebinds = player.actions.SaveBindingOverridesAsJson(); PlayerPrefs.SetString("rebinds", rebinds); } void LoadUserRebinds(PlayerInput player) { var rebinds = PlayerPrefs.GetString("rebinds"); player.actions.LoadBindingOverridesFromJson(rebinds); }
[1.0.0] - 2020-04-23
Fixed
- Fixed compilation issues in
TrackedDeviceRaycasterwhen disabling built-in XR module.
[1.0.0-preview.7] - 2020-04-17
Fixed
VirtualMouseInputnot moving the software cursor when set toHardwareCursorIsAvailablebut not having a hardware cursor ()- Can now override built-in Android gamepad layouts. Previously, the input system would always choose its default defaults even after registering more specific layouts using
InputSystem.RegisterLayout. InputControlPath.TryGetControlLayoutno longer throwsNotImplementedExceptionfor<Mouse>/scroll/xand similar paths where the layout is modifying a control it inherited from its base layout (thread).- Fixed compilation errors when disabling built-in VR and XR modules. (case 1214248).
- Fixed compilation errors when disabling built-in Physics and Physics2D modules. (case 1191392).
- No longer throws
NotImplementedExceptionwhen matching against a field ofInputDeviceDescription.capabilitieswhen the value of the field used scientific notation. - No longer incorrectly matches fields of
InputDeviceDescription.capabilitiesby prefix only (i.e. previously it would find the field "foo" when actually looking for "foobar"). - Input device debugger window slowing editor to a crawl when opened on PS4 DualShock controller.
InputUser.UnpairDevices()corrupting user device list.
Actions
- Controls are now re-resolved after adding or removing bindings from actions (case 1218544).
- Can now have spaces and special characters in action names when using
PlayerInputwith theSendMessagesorBroadcastMessagesbehavior. Previously, an incorrect method name was generated (fix contributed by BHSPitMonkey in #1022; case 1214519). - Adding a new action now sets
expectedControlTypetoButtonas expected (case 1221015). - Player joins with
PlayerInputManagerfrom 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). PlayerInputEditorno longer leads to the player'sInputActionAssetmistakenly getting replaced with a clone when the inspector is open on aPlayerInputcomponent (case 1228636).- The control picker in the .inputactions editor will no longer incorrectly filter out layouts such as
Xbox One Gamepad (on XB1)when using them in control schemes. Also, it will no longer filter out controls from base layouts (such asGamepad) (case 1219415). RebindOperations 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).- Newly added actions and action maps are now scrolled to when there are more items than fit into view. Previously newly added item was appended but outside of the visible area.
- Actions and bindings in the
.inputactionseditor are no longer force-expanded on every domain reload and whenever a new action or binding is added. - The importer for
.inputactionsassets will now check out from version control the generated .cs file when overwriting it – which only happens if the contents differ (case 1222972). - The editor for
.inputactionsassets will now check out from version control the asset before saving it. - Drag-reordering action maps no longer throws "Should have drop target" asserts in the console (case 1229146).
- Drag-reordering actions no longer changes action IDs of some of the existing actions (case 1231233).
- References to
InputActionReferenceobjects created by the importer for.inputactionsfiles are no longer broken when the action referenced by the object is renamed (case 1229145).- NOTE: This fix does not apply to existing
InputActionReferenceinstances. 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 theInputActionReference.
However, changing file IDs will break any existing reference to the object. Thus we had to preserve the existingInputActionReferenceobjects 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.
To switch existingInputActionReferenceproperties to the new file IDs, simply replace them with the newly createdInputActionReference.
- NOTE: This fix does not apply to existing
Changed
InputDevice.allhas been deprecated due to the confusion it creates with other getters likeGamepad.all. UseInputSystem.devicesinstead (case 1231216).- In the same vein, we added a new
Joystick.allgetter that works the same asGamepad.all.
- In the same vein, we added a new
- Changed UI Package to be optional dependency. Removing the package will now disable all UI relevant Input code.
[1.0.0-preview.6] - 2020-03-06
Changed
InputSystemUIInputModule.trackedDeviceSelecthas been removed. UseInputSystemUIInputModule.leftClickinstead.InputSystemUIInputModule.repeatDelayhas been renamed tomoveRepeatDelayandrepeatRatehas been renamed tomoveRepeatRate.
Fixed
- Fixed CS0109 warning being generated during player build due to use of
newwith thePlayerInput.camera property(case 1174688). - Fixed a number of issues in
InputSystemUIInputModule.- Fixed GC heap garbage when click-dragging.
- Fixed number of pointer states growing indefinitely if OS did not reuse touch IDs.
- Fixed
lastPressonPointerEventDatagetting lost. - Fixed button press-and-release happening in same frame resulting in no UI input.
- Fixed clicks initiated from non-pointer devices resulting in pointer inputs with
(0,0)positions. - Fixed huge screen deltas on pointer events from tracked devices.
- Fixed touch input not sending pointer exit events (case 1213550).
- Fixed
TrackedDeviceRaycasternot settingscreenPositioninRaycastResult.
Actions
- Mixing the enabling&disabling of single actions (as, for example, performed by
InputSystemUIInputModule) with enabling&disabling of entire action maps (as, for example, performed byPlayerInput) no longer leaves to unresponsive input and"should not reach here"assertions (forum thread). - Leaving play mode no longer leaves state change monitors lingering around from enabled actions.
- Enabling action maps with bindings that do not refer to an existing action in the map no longer leads to asserts and exceptions when input on the bindings is received (case 1213085).
PressInteractionno longer misses the next button press if it gets reset from within theperformedcallback (case 1205285).InputBinding.DisplayStringOptions.DontIncludeInteractionsis now properly respected.- Reading the value of a composite binding no longer causes processors from the last active part binding to be applied rather than the processors of the composite itself, if any (case 1207082).
- Fixed
InputSystem.onActionChangegetting invoked too many times on binding changes.
Added
InputSystemUIInputModulenow sends pointer events using a newExtendedPointerEventDatainstead of using the basePointerEventDataclass. This surfaces additional input data in pointer events.- Added
InputSystemUIInputModule.pointerBehaviorto allow dictating how the UI will resolve concurrent input from multiple pointers.
Actions
- Added
InputAction.CallbackContext.ReadValueAsButton.
[1.0.0-preview.5] - 2020-02-14
Changed
- We've changed the rules that govern how action phases have to progress:
- This is a breaking change!
- The primary effect is additional callbacks getting triggered.
- Before:
- There were no enforced rules about how an action would go through
InputAction.started,InputAction.performed, andInputAction.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 (likePressorHold). - This made for unpredictable and frequently surprising results. In addition, it led to bugs where, for example, adding a
Pressinteraction to theClickaction ofInputSystemUIInputModulewould cause the click state to get stuck because the click action would never cancel.
- There were no enforced rules about how an action would go through
- Now:
- The system will now always trigger
InputAction.startedfirst. If this is not done explicitly, it happens implicitly. - Likewise, the system will now always trigger
InputAction.canceledbefore going back to waiting state. Like withInputAction.started, if this isn't done explicitly, it will happen implicitly. This implies thatInputAction.canceledno 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. - In-between
InputAction.startedandInputAction.canceled,InputAction.performedmay be triggered arbitrary many times (including not at all).
- The system will now always trigger
- While late in the cycle for 1.0, we've opted to make this change now in order to fix a range of bugs and problems we've observed that people encountered because of the previous behavior of the system.
- This is a breaking change!
- Related to the change above, the behavior of
PressInteractionhas 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.
Vector2Compositenow has amodeparameter which can be used to choose betweenDigitalNormalized(the default),Digital(same asDigitalNormalizedbut does not normalize the resulting vector), andAnalog(uses float input values as is).Vector2Composite.normalizehas been deprecated. Note that it will not work together withAnalog. The parameter will be removed in the future.
Fixed
- XR controllers and HMDs have proper display names in the UI again. This regressed in preview.4 such that all XR controllers were displayed as just "XR Controller" in the UI and all HMDs were displayed as "XR HMD".
InputSystemUIInputModuleno longer generates GC heap garbage every time mouse events are processed.- Fixed a bug where an internal array helper method was corrupting array contents leading to bugs in both
InputUserandTouch. - Fixed exception when saving changes to an Input Action asset and the parent directory has been renamed. (case 1207527)
Actions
- The regression in 1.0.0-preview.4 of
PlayerInputManagernot joining players correctly if a scheme has more than one device requirement has been fixed.- This most notably manifested itself with keyboard+mouse control schemes.
PlayerInputManagerwill 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.- When no action map is selected in action editor, plus icon to add an action is now disabled; formerly threw an exception when clicked (case 1199562).
- Removing a callback from actions from the callback itself no longer throws
ArgumentOutOfRangeException(case 1192972). - "Invalid user"
ArgumentExceptionwhen turning the samePlayerInputon and off (case 1198889). - The list of device requirements for a control scheme in the action editor no longer displays devices with their internal layout name rather than their external display name.
StackOverflowExceptionwhenInvoke Unity Eventsis selected inPlayerInputand it cannot find an action (#1033).HoldInteractionnow stays performed after timer has expired and cancels only on release of the control (case 1195498).- Foldouts in the various action UIs now properly toggle their expansion state when clicked in Unity 2019.3+ (case 1213781).
Added
- We've added a new
Simple Multiplayersample which demonstrates a simple, bare-bones local multiplayer setup. - We've also added a
Gamepad Mouse Cursorsample that shows how to drive a UI mouse cursor using the gamepad.- The sample contains a reusable
VirtualMouseInputcomponent that does most of the work.
- The sample contains a reusable
- Added a
Deselect On Background Clickoption toInputSystemUIInputModule. This allows toggling the behavior off where clicking the mouse and not hitting aGameObjectwill automatically clear the current selection -- which will break keyboard and gamepad navigation.
[1.0.0-preview.4] - 2020-01-24
This release includes a number of Quality-of-Life improvements for a range of common problems that users have reported.
Added
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.
InputEventTracenow 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#Streaminstances, not just in file streams.// Write. myTrace.WriteTo("file.inputtrace"); // Read. InputEventTrace.LoadFrom("file.inputtrace");InputEventTracenow has built-in replay functionality.CSharp myTrace.Replay().PlayAllFramesOneByOne();- The event trace in device windows of the Input Debugger has been extended with controls to save and load traces.
- We've added a new
InputRecordingsample which has a reusableMonoBehaviourcomponent that can be used to capture and replay device activity. Keyboardnow has aFindKeyOnCurrentKeyboardLayoutmethod 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".
CSharp new InputAction(binding: "<Keyboard>/shift"); The controls are also available as properties on
Keyboard.if (Keyboard.current.shiftKey.isPressed) /* ... */; // Is equivalent to: if (Keyboard.current.leftShiftKey.isPressed || Keyboard.current.rightShiftKey.isPressed) /* ... */;
- This means that you can bind to just "shift" now, for example, instead of having to bind to both "left shift" and "right shift".
Actions
PlayerInputnow has a newControls Changedevent/message which is triggered when the control setup of the player changes (e.g. when switching control schemes).CSharp public void OnControlsChanged() { // Update UI display hints, for example... }- We've added APIs to simplify turning bindings into strings suitable for display in UIs.
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
DisplayStringFormatattribute to control how composites as a whole are turned into display strings.CSharp [DisplayStringFormat("{button}+{stick}")] public class MyComposite : InputBindingComposite<Vector2> { [InputControl(layout = "Button")] public int button; [InputControl(layout = "Stick")] public int stick; }
- Related to this, custom binding composites can now be annotated with the new
InputActionRebindingExtension.RebindingOperationhas a new configuration methodWithMatchingEventsBeingSuppressedwhich 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.- We've added two new samples:
- Rebinding UI: Demonstrates how to create a rebinding screen using the Input System's APIs. The sample also includes a reusable prefab you can use directly in your projects to quickly put rebinding screens together.
- In-Game Hints: Demonstrates how to show context-sensitive help that respects the current control scheme.
Changed
- The logic for resetting devices on focus loss has changed somewhat:
- When focus is lost, all devices are forcibly reset to their default state. As before, a
RequestResetCommandfor 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. - Noisy controls are exempted from resets. The assumption here is that noisy controls most often represent sensor readings of some kind (e.g. tracking data) and snapping the values back to their default will usually
- If
Application.runInBackgroundistrue, all devices that returntruefromInputDevice.canRunInBackgroundare exempted from resets entirely. This, for example, allows XR devices to continue running regardless of focus change. - This fixes problems such as keyboard keys getting stuck when alt-tabbing between applications (case 1206199).
- When focus is lost, all devices are forcibly reset to their default state. As before, a
InputControlExtensions.GetStatePtrFromStateEventno longer throwsInvalidOperationExceptionwhen the state format for the event does not match that of the device. It simply returnsnullinstead (same as when control is found in the event's state).InputEventTraceinstances are no longer disposed automatically from their finalizer but MUST be disposed of explicitly usingDispose().- This is to allow event traces to survive domain reloads. If they are disposed of automatically during finalizers, even if they survive the reload, the next GC will cause traces to be deallocated.
Actions
InputActionRebindingExtensions.PerformInteractiveRebindinghas 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>/escapewill 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
Vector2but the part binding expects aButton, the rebind switches automatically toButton). - 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
RebindingOperationfrom scratch yourself or wipe/alter the configuration returned byPerformInteractiveRebindinghowever you see fit.
- Control schemes can now handle ambiguity.
- This means that, for example, you can now have one control scheme for generic gamepads and another control scheme specifically for PS4 controllers and the system will reliably pick the PS4 scheme when a PS4 controller is used and fall back to the generic gamepad scheme otherwise.
- While this is exposed as a new
scoreproperty onInputControlScheme.MatchResult, no code changes are necessary to take advantage of this feature.
PlayerInput.activehas been renamed toPlayerInput.inputIsActiveto avoid ambiguities withGameObjectactivation.
Fixed
InputUserin combination with touchscreens no longer throwsInvalidOperationExceptioncomplaining about incorrect state format.- In a related change,
InputControlExtensions.GetStatePtrFromStateEventnow works with touch events, too.
- In a related change,
- Stack overflow in
InputTestFixture.currentTimegetter. - Input that occurs in-between pressing the play button and the game starting no longer leaks into the game (case 1191342).
- This usually manifested itself as large accumulated mouse deltas leading to such effects as the camera immediately jerking around on game start.
- Removing a device no longer has the potential of corrupting state change monitors (and thus actions getting triggered) from other devices.
- This bug led to input being missed on a device once another device had been removed.
TrackedDevicelayout is no longer incorrectly registered asTracked Device.- Event traces in the input debugger are no longer lost on domain reloads.
IndexOutOfRangeExceptionbeing thrown when looking up controls on XR devices.
Actions
- Clicking the "Replace with InputSystemUIInputModule" button in the inspector when looking at
StandaloneInputModule, the resulting operation is now undoable and will properly dirty the scene.
[1.0.0-preview.3] - 2019-11-14
Fixed
- Fixed wrong event handlers getting removed when having three or more handlers on an event (case 1196143).
- This was an bug in an internal data structure that impacted a number of code paths that were using the data structure.
- Fixed
LayoutNotFoundExceptionbeing thrown whenInputControlPath.ToHumanReadableStringreferenced a layout that could not be found.
[1.0.0-preview.2] - 2019-11-04
Changed
- Automatic conversion of window coordinates in
EditorWindowcode is now performed regardless of focus or the setting ofLock Input to Game Viewin the input debugger.
Fixed
- Fixed touch taps triggering when they shouldn't on Android.
- Fixed custom devices registered from
[InitializeOnLoad]code being lost on domain reload (case 1192379).- This happened when there were multiple pieces of
[InitializeOnLoad]code that accessed the input system in the project and theRegisterLayoutfor the custom device happened to not be the first in sequence.
- This happened when there were multiple pieces of
- OpenVR touchpad controls (
touchpadClicked&touchpadPressed) now report accurate data.
Actions
- Fixed missing keyboard bindings in
DefaultInputActions.inputactionsfor navigation in UI. - Fixed using C# reserved names in .inputactions assets leading to compile errors in generated C# classes (case 1189861).
- Assigning a new
InputActionAssetto aInputSystemUIInputModulewill no longer look up action names globally but rather only look for actions that are located in action maps with the same name.- Previously, if you e.g. switched from one asset where the
pointaction was bound toUI/Pointto an asset that had noUIaction map but did have an action calledPointsomewhere else, it would erroneously pick the most likely unrelatedPointaction for use by the UI.
- Previously, if you e.g. switched from one asset where the
- Fixed missing custom editors for
AxisDeadzoneProcessorandStickDeadzoneProcessorthat linkminandmaxvalues to input settings. - Fixed actions ending up being disabled if switching to a control scheme that has no binding for the action (case 1187377).
- Fixed part of composite not being bound leading to subsequent part bindings not being functional (case 1189867).
- Fixed
PlayerInputnot pairing devices added after it was enabled when not having control schemes.- This problem would also show in the
SimpleDemosample when having theCustomDeviceUsagessample installed as well. Gamepads would not get picked up in that case.
- This problem would also show in the
- Fixed
ArgumentNullExceptionwhen adding a device and a binding in an action map had an empty path (case 1187163). - Fixed bindings that are not associated with any control scheme not getting enabled with other control schemes as they should.
Added
- Added a new
EditorWindow Demosample that illustrates how to use the input system in editor UI code.
[1.0.0-preview.1] - 2019-10-11
Changed
- Generated action wrappers now won't
Destroythe generated Asset in a finalizer, but instead implementIDisposable. - Added back XR layouts (except for Magic Leap) that were removed for
1.0-preview.- We removed these layouts under the assumption that they would almost concurrently become available in the respective device-specific XR packages. However, this did not work out as expected and the gap here turned out to be more than what we anticipated.
- To deal with this gap, we have moved the bulk of the XR layouts back and will transition things gradually as support in device-specific packages becomes publicly available.
Fixed
- Fixed a bug where the Input Settings Window might throw exceptions after assembly reload.
- Correctly implemented
IsPointerOverGameObjectmethod forInputSystemUIInputModule. - Several bugs with layout overrides registered with (
InputSystem.RegisterLayoutOverrides).- In
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.
- In
- Selecting a layout in the input debugger no longer selects its first child item, too.
- Fixed XR devices reporting noise as valid user input (should fix problem of control schemes involving VR devices always activating when using
PlayerInput). - Fixed tap/swipe gesture detection in touch samples.
Actions
- Fixed a bug where multiple composite bindings for the same controls but on different action maps would throw exceptions.
- Fixed
anyKeynot appearing in control picker forKeyboard. - The text on the "Listen" button is no longer clipped off on 2019.3.
- Controls bound to actions through composites no longer show up as duplicates in the input debugger.
- Fixed "Create Actions..." on
PlayerInputcreating 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. - Fixed
Invoke CSharp Eventswhen selected inPlayerInputnot triggeringPlayerInput.onActionTriggered. - Fixed duplicating multiple items at the same time in the action editor duplicating them repeatedly.
Added
- Will now recognize Xbox One and PS4 controllers connected to iOS devices correctly as Xbox One and PS4 controllers.
- Added a new sample called "Custom Device Usages" that shows how to use a layout override on
Gamepadto allow distinguishing two gamepads in bindings based on which player the gamepad is assigned to. - Added abstract
TrackedDeviceinput device class as the basis for various kinds of tracked devices.
[1.0.0-preview] - 2019-09-20
Fixed
- Will now close Input Action Asset Editor windows from previous sessions when the corresponding action was deleted.
- Fixed an issue where Stick Controls could not be created in Players built with medium or high code stripping level enabled.
- Fixed incorrect default state for axes on some controllers.
Actions
- Fixed
CallbackContext.ReadValuethrowing when invoked during device removal
Changed
Added
[0.9.6-preview] - 2019-09-06
Fixed
- Exceptions in scenes of
Visualizerssample if respective device was not present on system (e.g. inPenVisualizerif no pen was present in system). - Fixed exception in Input Action Asset Editor window when typing whitespace into the search field.
- Fixed control scheme popup window in input action asset editor window showing in the correct screen position on windows.
Actions
- Setting timeouts from
IInputInteraction.Processnot working as expected when processing happened in response to previous timeout expiring (#714). - Pending timeouts on a device not being removed when device was removed.
Changed
- Replaced
HIDSupport.shouldCreateHIDevent with a newHIDSupport.supportedHIDUsagesproperty, which takes an array of supported usages.
Added
Actions
- Added
PlayerInput.neverAutoSwitchControlSchemesto disable logic that automatically enables control scheme switching when there is only a singlePlayerInputin the game. - Added
PlayerInput.SwitchControlSchemeto switch schemes manually.
[0.9.5-preview] - 2019-08-29
Fixed
- Don't pass events for null devices (for devices which have not been created) to
InputSystem.onEventcallbacks. - Will close debugger input state windows, when the state is no longer valid instead of throwing exceptions.
- Fixed pointer coordinates in editor windows for non-mouse pointing devices.
- Fixed using the input system in il2cpp when managed stripping level is set higher then "Low".
- Device debugger window will still show when reading from specific controls throws exceptions.
- Offsets and sizes for elements on Linux joysticks are now computed correctly.
- Joysticks now have a deadzone processor on the stick itself.
- Up/down/left/right on sticks are now deadzoned just like X and Y on sticks are.
- Removed toplevel
XandYcontrols on HIDs when there is aStick/XandStick/Yadded for the device. - HID fallback can now deal with sticks that have X and Y controls of different sizes and sitting in non-contiguous locations in the HID input report.
- Button 1 on HID joysticks will now correctly come out as the
triggercontrol. Previously, the trigger control on the joystick was left pointing to random state.
Actions
- Binding paths now show the same way in the action editor UI as they do in the control picker.
- For example, where before a binding to
<XInputController>/buttonSouthwas shown asrightShoulder [XInputController], the same binding will now show asA [Xbox Controller].
- For example, where before a binding to
- When deleting a control scheme, bindings are now updated. A dialog is presented that allows choosing between deleting the bindings or just unassigning them from the control scheme.
- When renaming a control scheme, bindings are now updated. Previously the old name was in place on bindings.
- Control scheme names can no longer be set to empty strings.
PlayerInput.Instantiatenow correctly sets up a given control scheme, if specified.- When passing a
controlScheme:argument, the result used to be a correctly assigned control scheme at theInputUserlevel but no restrictions being actually applied to the bindings, i.e. every single binding was active regardless of the specified control scheme.
- When passing a
- NullReferenceExceptions during event processing from
RebindingOperation.
Changed
InputUser.onUnpairedDeviceUsednow receives a 2nd argument which is the event that triggered the callback.- Also, the callback is now triggered BEFORE the given event is processed rather than after the event has already been written to the device. This allows updating the pairing state of the system before input is processed.
- In practice, this means that, for example, if the user switches from keyboard&mouse to gamepad, the initial input that triggered the switch will get picked up right away.
InputControlPath.ToHumanReadableStringnow takes display names from registeredInputControlLayoutinstances into account.- This means that the method can now be used to generate strings to display in rebinding UIs.
AxisControl.clampis now an enum-valued property rather than a bool. Can now perform clamping before normalization.
Actions
- When switching devices/controls on actions, the system will no longer subsequently force an initial state check on all actions. Instead, every time an action's bindings get re-resolved, the system will simply cancel all on-going actions and then re-enable them the same way it would happen by manually calling
InputAction.Enable. - Removed non-functional
InputControlScheme.baseSchemeAPI andbasedOnserialized property. This was never fully implemented.
Added
- Can right-click devices in Input Debugger (also those under "Unsupported") and select "Copy Device Description" to copy the internal
InputDeviceDescriptionof the device in JSON format to the system clipboard.- This information is helpful for us to debug problems related to specific devices.
- If a device description has been copied to the clipboard, a new menu "Paste Device Description as Device" entry in the "Options" menu of the input debugger appears. This instantiates the device from the description as if it was reported locally by the Unity runtime.
[0.9.3-preview] - 2019-08-15
Fixed
XInputControllerandXboxOneGamepadno longer have two extraneous, non-functional "menu" and "view" buttons.- Fixed
InputUser.onUnpairedDeviceUserignoring input on controls that do not supportEvaluateMagnitude.- This led to situations, for example, where
PlayerInputwould not initialize a control scheme switch from a<Mouse>/deltabinding as the delta X and Y axes do not have min&max limits and thus return -1 fromEvaluateMagnitude.
- This led to situations, for example, where
- Fixed available processor list not updated right away when changing the action type in the Input Action editor window.
Actions
NullReferenceExceptionwhen the input debugger is open with actions being enabled.- When selecting a device to add to a control scheme, can now select devices with specific usages, too (e.g. "LeftHand" XRController).
Changed
- Removed
timesliceEventssetting - and made this tied to the update mode instead. We now always time slice when using fixed updates, and not when using dynamic updates. - When adding a composite, only ones compatible with the value type of the current action are shown. This will, for example, no longer display a
2D Vectorcomposite as an option on a floating-point button action. - The
InputState.onChangecallback now receives a second argument which is the event (if any) that triggered the state change on the device.
Added
InputSystemUIInputModulecan 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.- Two new composite bindings have been added.
ButtonWithOneModifiercan be used to represent shortcut-like bindings such as "CTRL+1".ButtonWithTwoModifierscan be used to represent shortcut-like bindings such as "CTRL+SHIFT+1".
[0.9.2-preview] - 2019-08-09
Fixed
- A
RebindingOperationwill now fall back to the default path generation behavior if the callback provided toOnGeneratePathreturns null. - Fixed the Input Action editor window throwing exceptions when trying to view action properties.
Actions
PlayerInputwill now copy overrides when creating duplicate actions.- It is now possible to use an empty binding path with a non empty override path.
- It is now possible to use set an empty override path to disable a binding.
- It is not possible to query the effectively used path of a binding using
effectivePath. - Actions embedded into MonoBehaviour components can now have their properties edited in the inspector. Previously there was no way to get to the properties in this workflow. There is a gear icon now on the action that will open the action properties.
Changed
Added
- Added a new sample to the package called
SimpleDemo. You can install the sample from the package manager. See the README.md file for details about the sample.
[0.9.1-preview] - 2019-08-08
Fixed
- Fixed GC heap garbage being caused by triggered by event processing.
- This meant that every processing of input would trigger garbage being allocated on the managed heap. The culprit was a peculiarity in the C# compiler which caused a struct in
InputEventPtr.IsAto be allocated on the heap.
- This meant that every processing of input would trigger garbage being allocated on the managed heap. The culprit was a peculiarity in the C# compiler which caused a struct in
- The bindings selection popup window will now show child controls matching the current action type even if the parent control does not match.
- Fixed
durationvalues reported for Hold and Press interactions. - DualShock 3 on macOS:
- Fixed actions bound to the dpad control performing correctly.
- Fixed non-present touchpad button control being triggered incorrectly.
- Fixed compile issues with switch classes on standalone Linux.
- Leak of unmanaged memory in
InputControlList.
Actions
- Fixed actions not updating their set of controls when the usages of a device are changed.
- Composite bindings with the default interaction will now correctly cancel when the composite is released, even if there are multiple composite bindings on the action.
Changed
MouseState,KeyboardState, andGamepadStatehave been made public again.PlayerInputandPlayerInputManagerhave been moved from theUnityEngine.InputSystem.PlayerInputnamespace toUnityEngine.InputSystem.The signature of
InputSystem.onEventhas changed. The callback now takes a second argument which is the device the given event is sent to (null if there's no correspondingInputDevice).// Before: InputSystem.onEvent += eventPtr => { var device = InputSystem.GetDeviceById(eventPtr.deviceId); //... }; // Now: InputSystem.onEvent += (eventPtr, device) => { //... };- The signatures of
InputSystem.onBeforeUpdateandInputSystem.onAfterUpdatehave changed. The callbacks no longer receive anInputUpdateTypeargument.- Use
InputState.currentUpdateTypein case you need to know the type of update being run.
- Use
InputUpdateTypehas been moved to theUnityEngine.InputSystem.LowLevelnamespace.InputSystem.Update(InputUpdateType)has been removed from the public API.- The way input devices are built internally has been streamlined.
InputDeviceBuilderis now internal. It is no longer necessary to access it to look up child controls. Simply useInputControl.GetChildControlinstead.- To build a device without adding it to the system, call the newly added
InputDevice.Buildmethod.InputDevice.Build<Mouse>(); InputSystem.SetLayoutVarianthas been removed. Layout variants can no longer be set retroactively but must be decided on as part of device creation.
InputSystem.RegisterControlProcessorhas been renamed to justInputSystem.RegisterProcessor.
Actions
InputAction.ReadValue<TValue>()is longer correlated toInputAction.triggered. It simply returns the current value of a bound control or composite while the action is being interacted with.InputInteractionContext.PerformedAndGoBackToWaitinghas been renamed to justInputInteractionContext.Performed.
Actions
- Individual composite part bindings can now no longer have interactions assigned to them as that never made any sense.
Added
- Devices can now have more than one usage.
- Call
InputSystem.AddDeviceUsage(device,usage)to add additional usages to a device. - Call
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.
- Call
- A new
VisualizerSamplessample that can be installed through the package manager.- Contains two components
InputControlVisualizerandInputActionVisualizerthat help visualizing/debugging control/device and action activity through in-game overlays. A few sample scenes illustrate how to use them.
- Contains two components
Actions
- Added
InputAction.ReadValueAsObjectAPI. - Added
InputAction.activeControlAPI.
[0.9.0-preview] - 2019-07-18
Fixed
- Validate all parameters on public APIs.
- Fixed an internal bug in
InlinedArray.RemoveAtByMovingTailWithCapacity, which could cause data corruption. - Fixed Xbox controller support on macOS il2cpp.
- Fixed issue of Xbox gamepads on Windows desktop not being able to navigate left and down in a UI.
- Allow using InputSystem package if the XR, VR or Physics modules are disabled for smaller builds.
- Fixed documentation landing page and table of contents.
- Fixed tracked devices assigning pointer ids for UI pointer events correctly.
- Adjusted some UI Elements to fit the Unity 19.3 font.
- Fixed NullReferenceException being thrown when project changes.
- Fixed duplicate devices showing in the "Supported Devices" popup when using a search filter.
- Fixed an error when adding new bindings in the Input Actions editor window when a filter was applied.
- Fixed scroll wheel handling in
InputSystemUIInputModulenot being smooth. - Fixed compile errors from Switch Pro controller code on Linux.
Actions
- Fixed
CallbackContext.controlreferencing the composite member control which was actually actuated for this trigger for composite bindings. - Generated C# wrappers for .inputactions assets are no longer placed in Assets/Assets/ folder on Windows.
Added
- Touch support has been reworked and extended.
Touchscreen.touch[0..9]are now bindable from the control picker.Touchscreen.primaryTouchis now a separate control which tracks the primary touch on the screen.- The controls
Touchscreeninherits fromPointer(such asposition,phase, anddelta) are now tied toTouchscreen.primaryTouchand allow forTouchscreento function as a genericPointer(likeMouseandPen). Touchscreen.press(renamed fromTouchscreen.button) is now a working, synthetic button that is down whenever at least one finger is on the screen.- Recording of start time and start position has been added to touches.
TouchControl.startPositiongives the starting position of the touch.TouchControl.startTimegives the starting time of the touch.
- Tap detection has been added to
Touchscreen.- Tap time (i.e. time within which a press-and-release must be completed for a tap to register) corresponds to
InputSettings.defaultTapTime. - Tap release must happen within a certain radius of first contact. This is determined by a new setting
InputSettings.tapRadius. TouchControl.tapis 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 inUpdate, for example, will never trigger a tap. Either use actions to observe the button or use theTouchAPI fromEnhancedTouchto poll taps.
- Tap time (i.e. time within which a press-and-release must be completed for a tap to register) corresponds to
Touchscreen.activeToucheshas been removed. UseTouch.activeTouchesfrom the new enhanced touch API instead for more reliable touch tracking.Touchscreen.allTouchControlshas been renamed toTouchscreen.touches.- A new
EnhancedTouchplugin has been added which offers an enhancedTouchandFingerAPI 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. - Touch can be simulated from mouse or pen input now. To enable simulation, call
TouchSimulation.Enable()or put theTouchSimulationMonoBehaviour 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));- This change makes it possible to update state from state and thus synthesize input data from other input coming in.
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.
Actions
- Actions now also have a polling API!
InputAction.triggeredis true if the action was performed in the current frame.InputAction.ReadValue<TValue>()yields the last value thatstarted,performed, orcancelled(whichever came last) was called with. If the action is disabled, returnsdefault(TValue). ForInputActionType.Buttontype actions, returns1.0fiftriggered==trueand0.0fotherwise.
- Generated C# wrappers for .inputactions can now placed relative to the .inputactions file by specifying a path starting with './' (e.g.
./foo/bar.cs).
Changed
- The system no longer supports processing input in BOTH fixed and dynamic updates. Instead, a choice has to be made whether to process input before each
FixedUpdate()or before eachUpdate().- Rationale: the existing code that supported having both updates receive input independently still had several holes and became increasingly complex and brittle. Our solution was based on not actually processing input twice but on channeling input concurrently into both the state of both updates. Together with the fact that specific inputs have to reset (and possibly accumulate) correctly with respect to their update time slices, this became increasingly hard to do right. This, together with the fact that we've come to increasingly question the value of this feature, led us to removing the capability while preserving the ability to determine where input is processed.
- NOTE: Timeslicing is NOT affected by this. You can still switch to
ProcessEventInFixedUpdatesand get events timesliced to individualFixedUpdateperiods according to their timestamps. InputSettings.UpdateMode.ProcessEventsInBothFixedAndDynamicUpdatehas been removed.InputSettings.UpdateMode.ProcessEventsInDynamicUpdateOnlyhas been renamed toInputSettings.UpdateMode.ProcessEventsInDynamicUpdateand is now the default.InputSettings.UpdateMode.ProcessEventsInFixedUpdateOnlyhas been renamed toInputSettings.UpdateMode.ProcessEventsInFixedUpdate.
- Added icons for PlayerInput, PlayerInputManager, InputSystemUIInputModule and MultiplayerEventSystem components.
- Changed
KeyboardIME properties (imeEnabled,imeCursorPosition) to methods (SetIMEEnabled,SetIMECursorPosition). - Added getters to all
IInputRuntimeproperties. - Replace some
GetXxxmethods in our API withxxxproperties. Pointer.phasehas been removed andPointerPhasehas been renamed toTouchPhase. Phases are now specific to touch.PointerPhaseControlhas been renamed toTouchPhaseControl.Pointer.buttonhas been renamed toPointer.pressand now is a control that indicates whether the pointer is in "press down" state.- For mouse, corresponds to left button press.
- For pen, corresponds to tip contact.
- For touch, corresponds to primary touch contact (i.e. whether any finger is down).
- The state change monitor APIs (
IInputStateChangeMonitorand friends) have been moved out ofInputSysteminto a new static classInputStateinUnityEngine.Experimental.Input.LowLevel.- Rationale: These APIs are fairly low-level and not of general interest so having them out of
InputSystemreduces the API surface visible to most users.
- Rationale: These APIs are fairly low-level and not of general interest so having them out of
InputDeviceChange.StateChangedhas been removed and is now a separate callbackInputState.onChange.- Rationale: The other
InputDeviceChangenotifications are low-frequency whereasStateChangedis high-frequency. Putting them all on the same callback made adding a callback toInputSystem.onDeviceChangeunnecessarily expensive.
- Rationale: The other
IInputStateCallbackReceiverhas been rewritten from scratch. Now has two simple methodsOnNextUpdateandOnEvent. If implemented by a device, the device now has completely control over changing its own state. Use theInputState.Changemethods to affect state changes while trigger state change monitors (e.g. for actions) correctly.- Simplified handling of XR input in
InputSystemUIInputModuleby having only one set of actions for all XR devices. - We now use the same hierarchical device picker in the "Add Control Scheme" popup, which is already used in the "Input Settings" window.
- Made all
IInputStateTypeInfoimplementations internal, as these did not offer value to the user. - Made all
IInputDeviceCommandInfoimplementations internal, as these did not offer value to the user. - Removed
ReadWriteArray, which was only used for makingRebindingOperation.scoreseditable, which did not add any value. - Removed
PrimitiveValueOrArray, as non of it's functionality overPrimitiveValuewas implemented. - Made all
InputProcessorimplementation internal, as access to these types is exposed only through text mode representations. - Removed
CurveProcessoras it was not implemented. - Renamed XInputControllerOSX to a more descriptive XboxGamepadMacOS.
Actions
InputAction.continuoushas been removed. Running logic every frame regardless of input can easily be achieved in game code.- The way action behavior is configured has been simplified.
- The previous roster of toggles has been replaced with two settings:
Action Type: Determines the behavior of the action. Choices areValue,Button, andPassThrough.Control Type: Determines the type of control (and implicitly the type of value) the action is looking for if the action is aValueorPassThroughaction.
- The previous
Initial State Checktoggle is now implicit in the action type now.Valueactions 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. - The previous
Pass Throughtoggle is now rolled into the action type.
- The previous roster of toggles has been replaced with two settings:
[0.2.10-preview] - 2019-05-17
Added
- Added a
MultiplayerEventSystemclass, which allows you use multiple UI event systems to control different parts of the UI by different players. InputSystemUIInputModulenow lets you specify anInputActionAssetin theactionsAssetproperty. If this is set, the inspector will populate all actions from this asset. If you have aPlayerInputcomponent on the same game object, referencing the sameInputActionAsset, thePlayerInputcomponent will keep the actions on theInputSystemUIInputModulein synch, allowing easy setup of multiplayer UI systems.
Changed
StickControl.xandStickControl.yare now deadzoned, i.e. haveAxisDeadzoneprocessors on them. This affects all gamepads and joysticks.- NOTE: The deadzoning is independent of the stick. Whereas the stack has a radial deadzones,
xandyhave linear deadzones. This means thatleftStick.ReadValue().xis not necessary equal toleftStick.x.ReadValue(). - This change also fixes the problem of noise from sticks not getting filtered out and causing devices such as the PS4 controller to constantly make itself
Gamepad.current.
- NOTE: The deadzoning is independent of the stick. Whereas the stack has a radial deadzones,
Redesigned
UIActionInputModule- Added a button in the inspector to automatically assign actions from an input action asset based on commonly used action names.
- Will now populate actions with useful defaults.
- Removed
clickSpeedproperty - will use native click counts from the OS where available instead. - Removed
sendEventsWhenInBackgroundproperty. - Hiding
TouchesandTrackedDevicesuntil we decide how to handle them. - Remove
moveDeadzoneproperty as it is made redundant by the action's dead zone. - Removed
UIActionInputModuleEnablercomponent,UIActionInputModulewill 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.InputtoUnityEngine.InputSystem. - Generated wrapper code now has nicer formatting.
- Renamed
UIActionInputModuletoInputSystemUIInputModule. - Nicer icons for
InputActionAssetsandInputActionsand forButtonand generic controls. - Change all public API using
IntPtrto use unsafe pointer types instead. PlayerInputwill 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
Pluginsfrom all namespaces. - Rename "Cancelled" -> "Canceled" (US spelling) in all APIs.
Fixed
- Adding devices to "Supported Devices" in input preferences not allowing to select certain device types (like "Gamepad").
- Fixed scrolling in
UIActionInputModule. - Fixed compiling the input system package in Unity 19.2 with ugui being moved to a package now.
- In the Input System project settings window, you can no longer add a supported device twice.
Actions
- Custom inspector for
PlayerInputno longer adds duplicates of action events ifInvoke Unity Eventsnotification behavior is selected. - Fixed
Holdinteractions firing immediately before the duration has passed. - Fixed editing bindings or processors for
InputActionfields in the inspector (Changes wouldn't persist before). - Fixed exception message when calling
CallbackContext.ReadValue<TValue>()for an action with a composite binding withTValuenot matching the composite's value type.
Added
Actions
PlayerInputcan now handle.inputactionsassets that have no control schemes.- Will pair all devices mentioned by any of the bindings except if already paired to another player.
[0.2.8-preview] - 2019-04-23
Added
- Added a
clickCountcontrol to theMouseclass, which specifies the click count for the last mouse click (to allow distinguishing between single-, double- and multi-clicks). - Support for Bluetooth Xbox One controllers on macOS.
Actions
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();
Changed
Joystick.axesandJoystick.buttonshave been removed.- Generated wrapper code for Input Action Assets are now self-contained, generating all the data from code and not needing a reference to the asset;
InputActionAssetReferencehas been removed. - The option to generate interfaces on wrappers has been removed, instead we always do this now.
- The option to generate events on wrappers has been removed, we felt that this no longer made sense.
- Will now show default values in Input Action inspector if no custom values for file path, class name or namespace have been provided.
InputSettings.runInBackgroundhas 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.- Several new
Sensor-based classes have been added. Various existing Android sensor implementations are now based on them. InputControlLayoutAttributeis no longer inherited.- Rationale: A class marked as a layout will usually be registered using
RegisterLayout. A class derived from it will usually be registered the same way. Because of layout inheritance, properties applied to the base class throughInputControlLayoutAttributewill affect the subclass as intended. Not inheriting the attribute itself, however, now allows having properties such asisGenericTypeOfDevicewhich should not be inherited.
- Rationale: A class marked as a layout will usually be registered using
- Removed
acceleration,orientation, andangularVelocitycontrols fromDualShockGamepadbase class.- They are still on
DualShockGamepadPS4. - The reason is that ATM we do not yet support these controls other than on the PS4. The previous setup pretended that these controls work when in fact they don't.
- They are still on
- Marking a control as noisy now also marks all child controls as noisy.
- The input system now defaults to ignoring any HID devices with usage types not known to map to game controllers. You can use
HIDSupport.supportedUsagesto enable specific usage types. - In the Input Settings window, asset selection has now been moved to the "gear" popup menu. If no asset is created, we now automatically create one.
- In the inspector for Input Settings assets, we now show a button to go to the Input Settings window, and a button to make the asset active if it isn't.
- Tests are now no longer part of the com.unity.inputsystem package. The
InputTestFixtureclass still is for when you want to write input-related tests for your project. You can reference theUnity.InputSystem.TestFixtureassembly when you need to do that. - Implemented adding usages to and removing them from devices.
Actions
- A number of changes have been made to the control picker UI in the editor. \

- The button to pick controls interactively (e.g. by pressing a button on a gamepad) has been moved inside the picker and renamed to "Listen". It now works as a toggle that puts the picker into a special kind of 'search' mode. While listening, suitable controls that are actuated will be listed in the picker and can then be picked from.
- Controls are now displayed with their nice names (e.g. "Cross" instead of "buttonSouth" in the case of the PS4 controller).
- Child controls are indented instead of listed in "parent/child" format.
- The hierarchy of devices has been rearranged for clarity. The toplevel groups of "Specific Devices" and "Abstract Devices" are now merged into one hierarchy that progressively groups devices into more specific groups.
- Controls now have icons displayed for them.
- There is new support for binding to keys on the keyboard by their generated character rather than by their location. \

- At the toplevel of the Keyboard device, you now have the choice of either binding by keyboard location or binding by generated/mapped character.
- Binding by location shows differences between the local keyboard layout and the US reference layout.
- The control path language has been extended to allow referencing controls by display name.
<Keyboard>/#(a)binds to the control on aKeyboardwith the display namea.
continuousflag is now ignored forPress and Releaseinteractions, as it did not make sense.- Reacting to controls that are already actuated when an action is enabled is now an optional behavior rather than the default behavior. This is a breaking change.
- Essentially, this change reverts back to the behavior before 0.2-preview.
- To reenable the behavior, toggle "Initial State Check" on in the UI or set the
initialStateCheckproperty in code.
- The reason for the change is that having the behavior on by default made certain setups hard to achieve. For example, if
<Keyboard>/escapeis 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 ifescapewas 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.
- Processors and Interactions are now shown in a component-inspector-like fashion in the Input Action editor window, allowing you to see the properties of all items at once.
- The various
InputAction.lastTriggerXXXAPIs have been removed.- Rationale: They have very limited usefulness and if you need the information, it's easy to set things up in order to keep track of it yourself. Also, we plan on having a polling API for actions in the future which is really what the
lastActionXXXAPIs were trying to (imperfectly) solve.
- Rationale: They have very limited usefulness and if you need the information, it's easy to set things up in order to keep track of it yourself. Also, we plan on having a polling API for actions in the future which is really what the
Tap,SlowTap, andMultiTapinteractions now respect button press points.Tap,SlowTap, andMultiTapinteractions now have improved parameter editing UIs.
Fixed
- Input Settings configured in the editor are now transferred to the built player correctly.
- Time slicing for fixed updates now works correctly, even when pausing or dropping frames.
- Make sure we Disable any InputActionAsset when it is being destroyed. Otherwise, callbacks which were not cleaned up would could cause exceptions.
- DualShock sensors on PS4 are now marked as noisy (#494).
- IL2CPP causing issues with XInput on windows and osx desktops.
- Devices not being available yet in
MonoBehavior.Awake,MonoBehaviour.Start, andMonoBehaviour.OnEnablein player or when entering play mode in editor. - Fixed a bug where the event buffer used by
InputEventTracecould get corrupted.
Actions
- Actions and bindings disappearing when control schemes have spaces in their names.
InputActionRebindingExceptions.RebindOperationcan now be reused as intended; used to stop working properly the first time a rebind completed or was cancelled.- Actions bound to multiple controls now trigger correctly when using
PressInteractionset toReleaseOnly(#492). PlayerInputno longer fails to find actions when using UnityEvents (#500).- The
"{...}"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. - Drag&dropping bindings between other bindings that came before them in the list no longer drops the items at a location one higher up in the list than intended.
- Editing name of control scheme in editor not taking effect except if hitting enter key.
- Saving no longer causes the selection of the current processor or interaction to be lost.
- This was especially annoying when having "Auto-Save" on as it made editing parameters on interactions and processors very tedious.
- In locales that use decimal separators other than '.', floating-point parameters on composites, interactions, and processors no longer lead to invalid serialized data being generated.
- Fix choosing "Add Action" in action map context menu throwing an exception.
- The input action asset editor window will no longer fail saving if the asset has been moved.
- The input action asset editor window will now show the name of the asset being edited when asking for saving changes.
- Clicking "Cancel" in the save changes dialog for the input action asset editor window will now cancel quitting the editor.
- Fixed pasting or dragging a composite binding from one action into another.
- In the action map editor window, switching from renaming an action to renaming an action map will no longer break the UI.
- Fixed calling Enable/Disable from within action callbacks sometimes leading to corruption of state which would then lead to actions not getting triggered (#472).
- Fixed setting of "Auto-Save" toggle in action editor getting lost on domain reload.
- Fixed blurry icons in editor for imported .inputactions assets and actions in them.
PressandReleaseinteractions will now work correctly if they have multiple bound controls.Releaseinteractions will now invoke aStartedcallback when the control is pressed.- Made Vector2 composite actions respect the press points of button controls used to compose the value.
[0.2.6-preview] - 2019-03-20
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
Added
- Support gamepad vibration on Switch.
- Added support for Joysticks on Linux.
Actions
- Added ability to change which part of a composite a binding that is part of the composite is assigned to.
- Part bindings can now be freely duplicated or copy-pasted. This allows having multiple bindings for "up", for example. Changing part assignments retroactively allows to freely edit the composite makeup.
- Can now drag&drop multiple items as well as drop items onto others (equivalent to cut&paste). Holding ALT copies data instead of moving it.
- Edits to control schemes are now undoable.
- Control schemes are now sorted alphabetically.
- Can now search by binding group (control scheme) or devices directly from search box.
g:Gamepadfilters bindings to those in the "Gamepad" group.d:Gamepadfilters bindings to those from Gamepad-compatible devices.
Changed
- The input debugger will no longer automatically show remote devices when the profiler is connected. Instead, use the new menu in debugger toolbar to connect to players or to enable/disable remote input debugging.
- "Press and Release" interactions will now invoke the
performedcallback on both press and release (instead of invokingperformedandcancel, which was inconsistent with other behaviors).
Actions
- Bindings have GUIDs now like actions and maps already did. This allows to persistently and uniquely identify individual bindings.
- Replaced UI overlay while rebinding interactively with cancellable progress bar. Interactive rebinding now cancels automatically after 4 seconds without suitable input.
- Bindings that are not assigned to any control scheme are now visible when a particular control scheme is selected.
- Bindings not assigned to any control scheme are active in ALL control schemes.
- The change makes this visible in the UI now.
- When a specific control scheme is selected, these bindings are affixed with
{GLOBAL}for added visibility.
- When filtering by devices from a control scheme, the filtering now takes layout inheritance into account. So, a binding to a control on
Pointerwill now be shown when the filter isMouse. - The public control picker API has been revised.
- The simplest way to add control picker UI to a control path is to add an
InputControlAttributeto 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;
- The simplest way to add control picker UI to a control path is to add an
- Processors of incompatible types will now be ignored instead of throwing an exception.
Fixed
- Remote connections in input debugger now remain connected across domain reloads.
- Don't incorrectly create non-functioning devices if a physical device implements multiple incompatible logical HID devices (such as the MacBook keyboard/touch pad and touch bar).
- Removed non-functioning sort triangles in event list in Input Debugger device windows.
- Sort events in input debugger window by id rather then by timestamp.
- Make parsing of float parameters support floats represented in "e"-notation and "Infinity".
- Input device icons in input debugger window now render in appropriate resolution on retina displays.
- Fixed Xbox Controller on macOS reporting negative values for the sticks when represented as dpad buttons.
InputSettings.UpdateMode.ProcessEventsManuallynow correctly triggers updates when callingInputSystem.Update(InputUpdateType.Manual).
Actions
- Pasting or duplicating an action in an action map asset will now assign a new and unique ID to the action.
- "Add Action" button being active and triggering exceptions when no action map had been added yet.
- Fixed assert when generating C# class and make sure it gets imported correctly.
- Generate directories as needed when generating C# class, and allow path names without "Assets/" path prefix.
- Allow binding dpad controls to actions of type "Vector2".
- Fixed old name of action appearing underneath rename overlay.
- Fixed inspector UIs for on-screen controls throwing exceptions and being non-functional.
- Fixed deleting multiple items at same time in action editor leading to wrong items being deleted.
- Fixed copy-pasting actions not preserving action properties other than name.
- Fixed memory corruptions coming from binding resolution of actions.
- InputActionAssetReferences in ScriptableObjects will continue to work after domain reloads in the editor.
- Fixed
startTimeanddurationproperties of action callbacks.
[0.2.1-preview] - 2019-03-11
Changed
- NativeUpdateCallback API update to match Unity 2018.3.8f1
[0.2.0-preview] - 2019-02-12
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.
Changed
- Removed Unity 2018.2 support code.
- Removed .NET 3.5 support code.
- Started using C# 7.
IInputControlProcessor<TValue>has been replaced withInputProcessorandInputProcessor<TValue>base classes.IInputBindingCompositehas been replaced with anInputBindingCompositebase class and theIInputBindingComposite<TValue>interface has been merged with theInputBindingComposite<TValue>class which had already existed.InputUser.onUnpairedDeviceUserwill now notify for each actuated control until the device is paired or there are no more actuated controls.SensitivityProcessorhas been removed.- The approach needs rethinking. What
SensitivityProcessordid caused more problems than it solved.
- The approach needs rethinking. What
- State monitors no longer have their timeouts removed automatically when they fire. This makes it possible to have a timeout that is removed only in response to a specific state change.
- Events for devices that implement
IInputStateCallbacks(such asTouchscreen) 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.Buttonis nowPenButton.- Removed TouchPositionTransformProcessor, was used only by Android, the position transformation will occur in native backend in 2019.x
Actions:
- Bindings that have no interactions on them will trigger differently now. This is a breaking change.
- Previously, these bindings would trigger
performedon every value change including when going back to their default value. This is why you would see two calls ofperformedwith a button; one when the button was pressed, another when it was depressed. - Now, a binding without an interaction will trigger
startedand thenperformedwhen a bound control is actuated. Thereafter, the action will remain inStartedphase. For as long as the control is actuated, every value change will triggerperformedagain. When the control stops being actuated, it will triggercancelledand the action will remain inWaitingstate. - Control actuation is defined as a control having a magnitude (see
InputControl.EvaluateMagnitude) greater than zero. If a control does not support magnitudes (returns -1 fromEvaluateMagnitude), 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;tomyAction.performed += MyCallback; myAction.cancelled += MyCallback; - Alternatively, enable
passThroughmode on an action. This effectively restores the previous default behavior of actions.new InputAction(binding: "<Gamepad>/leftTrigger") { passThrough = true };
- Previously, these bindings would trigger
- 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 whatStickInteractiondid. Usestartedto know then the stick starts being actuated,performedto be updated on movements, andcancelledto 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. Usestartedto know then a button is pressed andcancelledto know when it is released. To set a custom button press point, simply put anAxisDeadzoneProcessoron the binding.
PressInteractionhas been completely rewritten.- Trigger behavior can be set through
behaviorparameter and now provides options for observing just presses (PressOnly), just releases (ReleaseOnly), or both presses and releases (PressAndRelease). - Also, the interaction now operates on control actuation rather than reading out float values directly. This means that any control that supports magnitudes can be used.
- Also supports continuous mode now.
- Trigger behavior can be set through
- 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.
- In other words, if e.g. you have a binding to the A button of the gamepad and the A button is already pressed when the action is first enabled, then the action associated with the A button will trigger as if the button had just been pressed. Previously, it required releasing and re-pressing the button first -- which, together with certain interactions, could lead to actions ending up in a confused state.
- When an action is disabled, it will now cancel all ongoing interactions, if any (i.e. you will see
InputAction.cancelledbeing called).- Note that unlike the above-mentioned callbacks that happen when an action starts out with a control already actuated, the cancellation callbacks happen immediately rather than in the next input update.
- Actions that at runtime are bound to multiple controls will now perform conflict resolution, if necessary.
- This applies only if an action actually receives multiple concurrent actuations from controls.
- When ambiguity is detected, the greatest amount of actuation on any of the controls gets to drive the action.
- In practice, this means that as long as any of the controls bound to an action is actuated, the action will keep going. This resolves ambiguities when an action has primary and secondary bindings, for examples, or when an action is bound to multiple different devices at the same time.
- Composite bindings count as single actuations regardless of how many controls participate in the composite.
- This behavior can be bypassed by setting the action to be pass-through.
- Action editor now closes when asset is deleted.
- If there are unsaved changes, asks for confirmation first.
- 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.
- The old names can still be used and existing data will load as expected.
DpadCompositegot renamed toVector2Composite;AxisCompositeis unchanged.
InputInteractionContext.controlHasDefaultValuehas been replaced withInputInteractionContext.ControlIsActuated().InputActionChange.BindingsHaveChangedWhileEnabledhas 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.
- Disposing should be taken care of automatically (though you can manually
Disposeas well). If you see errors in the console log about unmanaged memory being leaked, please report the bug. - All execution state except for C# heap objects for processors, interactions, and composites has been collapsed into a single block of unmanaged memory. Actions should now be able to re-resolve efficiently without allocating additional GC memory.
- Disposing should be taken care of automatically (though you can manually
Added
PlayerInputcomponent which simplifies setting up individual player input actions and device pairings. \
PlayerInputManagercomponent which simplifies player joining and split-screen setups. \
InputDevice.all(equivalent toInputSystem.devices)InputControl.IsActuated()can be used to determine whether control is currently actuated (defined as extension method inInputControlExtensions).- Can now read control values from buffers as objects using
InputControl.ReadValueFromBufferAsObject. This allows reading a value stored in memory without having to know the value type. - New processors:
ScaleProcessorScaleVector2ProcessorScaleVector3ProcessorInvertVector2ProcessorInvertVector3ProcessorNormalizeVector2ProcessorNormalizeVector3Processor
- Added
MultiTapInteraction. Can be used to listen for double-taps and the like. - Can get total and average event lag times through
InputMetrics.totalEventLagTimeandInputMetrics.averageEventLagTime. Mouse.forwardButtonandMouse.backButton.- The input debugger now shows users along with their paired devices and actions. See the documentation
- Added third and fourth barrel buttons on
Pen.
Actions:
- Actions have a new continuous mode that will cause the action to trigger continuously even if there is no input. See the documentation for details. \

- Actions have a new pass-through mode. In this mode an action will bypass any checks on control actuation and let any input activity on the action directly flow through. See the documentation for details. \

- Can now add interactions and processors directly to actions.

- This is functionally equivalent to adding the respective processors and/or interactions to every binding on the action.
- Can now change the type of a composite retroactively.

- Values can now be read out as objects using
InputAction.CallbackContext.ReadValueAsObject().- Allocates GC memory. Should not be used during normal gameplay but is very useful for testing and debugging.
- Added auto-save mode for .inputactions editor.

- Processors, interactions, and composites can now define their own parameter editor UIs by deriving from
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.
InputActionTracehas seen various improvements.- Recorded data will now stay valid even if actions are rebound to different controls.
- Can listen to all actions using
InputActionTrace.SubscribeToAll. InputActionTracenow maintains a list of subscriptions. Add subscriptions withSubscribeToand remove a subscription withUnsubscribeFrom. See the documentation for details.
Fixes
- Fixed support for Unity 2019.1 where we landed a native API change.
InputUser.UnpairDevicesAndRemoveUser()corrupting device pairings of other InputUsers- Control picker in UI having no devices if list of supported devices is empty but not null
IndexOutOfRangeExceptionwhen having multiple action maps in an asset (#359 and #358).- Interactions timing out even if there was a pending event that would complete the interaction in time.
- Action editor updates when asset is renamed or moved.
- Exceptions when removing action in last position of action map.
- Devices marked as unsupported in input settings getting added back on domain reload.
- Fixed
Pencausing exceptions and asserts. - Composites that assign multiple bindings to parts failing to set up properly when parts are assigned out of order (#410).
Known Issues
- Input processing in edit mode on 2019.1 is sporadic rather than happening on every editor update.
[0.1.2-preview] - 2018-12-19
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.
Changed
InputConfigurationhas been replaced with a newInputSettingsclass.InputConfiguration.lockInputToGamehas been moved toInputEditorUserSettings.lockInputToGameView. This setting is now persisted as a local user setting.InputSystem.updateMaskhas been replaced withInputSettings.updateMode.InputSystem.runInBackgroundhas been moved toInputSettings.runInBackground.- Icons have been updated for improved styling and now have separate dark and light skin versions.
Lock Input To GameandDiagnostics Modeare now persisted as user settings- Brought back
.currentgetters and addedInputSettings.filterNoiseOnCurrentto control whether noise filtering on the getters is performed or not. - Removed old and outdated Doxygen-generated API docs.
Added
InputSystem.settingscontains the current input system settings.- A new UI has been added to "Edit >> Project Settings..." to edit input system settings. Settings are stored in a user-controlled asset in any location inside
Assets/. Multiple assets can be used and switched between. - Joystick HIDs are now supported on Windows, Mac, and UWP.
- Can now put system into manual update mode (
InputSettings.updateMode). In this mode, events will not get automatically processed. To process events, callInputSystem.Update(). - Added shortcuts to action editor window (requires 2019.1).
- Added icons for .inputactions assets.
Fixed
InputSystem.devicesnot yet being initialized inMonoBehaviour.Startwhen in editor.
Known Issues
- Input settings are not yet included in player builds. This means that at the moment, player builds will always start out with default input settings.
- There have been reports of some stickiness to buttons on 2019.1 alpha builds. We are looking at this now.
[0.0.14-preview] - 2018-12-11
Changed
Pointer.deltano longer hasSensitivityProcessoron 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.
Fixed
Core:
- Invalid memory accesses when using .NET 4 runtime
- Mouse.button not being identical to Mouse.leftButton
- DualShock not being recognized when connected via Bluetooth
Actions:
- Parameters disappearing on processors and interactions in UI when edited
- Parameters on processors and interactions having wrong value type in UI (e.g. int instead of float)
- RebindingOperation calling OnComplete() after being cancelled
Misc:
- Documentation no longer picked up as assets in user project
[0.0.13-preview] - 2018-12-05
First release from stable branch.