1.4.0 #
Changed
Fixed
Added
Changed
Button
typeInputAction
s now go tostarted
when a button goes from a press to below the release threshold but not yet to 0.// Before: Set(Gamepad.current.rightTrigger, 0.7f); // Performed (pressed) Set(Gamepad.current.rightTrigger, 0.2f); // Canceled (released) Set(Gamepad.current.rightTrigger, 0.1f); // Started!! Set(Gamepad.current.rightTrigger, 0f); // Canceled // Now: Set(Gamepad.current.rightTrigger, 0.7f); // Performed (pressed) Set(Gamepad.current.rightTrigger, 0.2f); // Started (released but not fully) Set(Gamepad.current.rightTrigger, 0.1f); // <Nothing> Set(Gamepad.current.rightTrigger, 0f); // Canceled
- This also applies to
PressInteraction
when set toPress
behavior. - In effect, it means that a button will be in
started
orperformed
phase for as long as its value is not 0 and will only go tocanceled
once dropping to 0.
- This also applies to
- Processors are now always applied when reading action values through
InputAction.ReadValue<>
orCallbackContext.ReadValue<>
. Previously, if no bound control was actuated, ReadValue calls would return the default value for the action type but not run the value through the processors.(case 1293728). - Made the following internal types public. These types can be useful when deconstructing raw events captured via
InputEventTrace
.UnityEngine.InputSystem.Android.LowLevel.AndroidAxis
UnityEngine.InputSystem.Android.LowLevel.AndroidGameControllerState
UnityEngine.InputSystem.Android.LowLevel.AndroidKeyCode
- Adding or removing a device no longer leads to affected actions being temporarily disabled (case 1379932).
- If, for example, an action was bound to
<Gamepad>/buttonSouth
and was enabled, adding a secondGamepad
would lead to the action being temporarily disabled, then updated, and finally re-enabled. - This was especially noticeable if the action was currently in progress as it would get cancelled and then subsequently resumed.
- Now, an in-progress action will get cancelled if the device of its active control is removed. If its active control is not affected, however, the action will keep going regardless of whether controls are added or removed from its
InputAction.controls
list.
- If, for example, an action was bound to
- Installing the package for the first time will now set
"Active Input Handling"
to"Both"
rather than"Input System Package"
.- This means, that by default, both the old and the new input system will run side by side where supported.
- This can be manually switched by going to
Edit >> Project Settings >> Player >> Active Input Handling
.
Fixed
- Fixed an issue where a layout-override registered via
InputSystem.RegisterLayoutOverride(...)
would cause the editor to malfunction or crash if the layout override had a name already used by an existing layout (case 1377685). - Fixed an issue where attempting to replace an existing layout-override by using an existing layout-override name didn't work as expected and would instead aggregate overrides instead of replacing them when an override with the given name already exists.
- Fixed Switch Pro controller not working correctly in different scenarios (case 1369091, case 1190216, case 1314869).
- Fixed DualShock 4 controller not allowing input from other devices due to noisy input from its unmapped sensors (case 1365891).
- Fixed
InputSystem.onAnyButtonPress
so that it doesn't throw exceptions when trying to process non state or delta events (case 1376034). - Fixed
InputControlPath.Matches
incorrectly reporting matches when only a prefix was matching.- This would, for example, cause
Keyboard.eKey
to be matched by<Keyboard>/escape
. - Fix contributed by Fredrik Ludvigsen in #1485.
- This would, for example, cause
- Fixed
OnScreenButton
triggeringNullReferenceException
in combination with custom devices (case 1380790 ). - Fixed no devices being available in
Start
andAwake
methods if, in the player, anyInputSystem
API was accessed during theSubsystemRegistration
phase (case 1392358). - Fixed dropdown for "Supported Devices" in settings not showing all device layouts.
- Fixed "STAT event with state format TOUC cannot be used with device 'Touchscreen:/Touchscreen'" when more than max supported amount of fingers, currently 10, are present on the screen at a same time (case 1395648).
- Fixed mouse events not being timesliced when input system is switched to process input in fixed updates (case 1386738).
- Fixed missing tooltips in PlayerInputManagerEditor for the Player Limit and Fixed Splitscreen sizes labels (case 1396945).
- Fixed DualShock 4 controllers not working in some scenarios by adding support for extended mode HID reports (case 1281633, case 1409867).
- Fixed
BackgroundBehavior.IgnoreFocus
having no effect whenApplication.runInBackground
was false (case 1400456). - Fixed an issue where a device was left disabled when it was disconnected while an application was out-of-focus and then re-connected when in-focus (case 1404320).
Actions
- Fixed
InvalidCastException: Specified cast is not valid.
being thrown when clicking on menu separators in the control picker (case 1388049). - Fixed accessing
InputAction
s directly duringRuntimeInitializeOnLoad
not initializing the input system as a whole and leading to exceptions (case 1378614). - Fixed
InputAction.GetTimeoutCompletionPercentage
jumping to 100% completion early (case 1377009). - Fixed d-pad inputs sometimes being ignored on actions that were binding to multiple controls (case 1389858).
- Fixed
IndexOutOfRangeException
when having multiple interactions on an action and/or binding in an action map other than the first of an asset (case 1392559).- Fix contributed by Russell Quinn in #1483.
- Fixed
AxisComposite
not respecting processors applied topositive
andnegative
bindings (case 1398942).- This was a regression introduced in 1.0.0-pre.6.
- Fixed calling
action.AddCompositeBinding(...).With(...)
while action is enabled not correctly updating controls for part bindings of the composite. - Fixed
TwoModifiersComposite
inadvertently not allowing controls other thanButtonControl
s being bound to itsbinding
part. - Added support for keyboard shortcuts and mutually exclusive use of modifiers.
- In short, this means that a "Shift+B" binding can now prevent a "B" binding from triggering.
OneModifierComposite
,TwoModifiersComposite
, as well as the legacyButtonWithOneModifierComposite
andButtonWithTwoModifiersComposite
now require their modifiers to be pressed before (or at least simultaneously with) pressing the target button.- This check is performed only if the target is a button. For a binding such as
"CTRL+MouseDelta"
the check is bypassed. It can also be manually bypassed via theoverrideModifiersNeedToBePressedFirst
.
- This check is performed only if the target is a button. For a binding such as
- State change monitors on a device (
IInputStateChangeMonitor
) are now sorted by theirmonitorIndex
and will trigger in that order. - Actions are now automatically arranging their bindings to trigger in the order of decreasing "complexity". This metric is derived automatically. The more complex a composite a binding is part of, the higher its complexity. So,
"Shift+B"
has a higher "complexity" than just"B"
. - If an binding of higher complexity "consumes" a given input, all bindings waiting to consume the same input will automatically get skipped. So, if a
"Shift+B"
binding composite consumes a"B"
key press, a binding to"B"
that is waiting in line will get skipped and not see the key press. - If your project is broken by these changes, you can disable the new behaviors via a feature toggle in code:
InputSystem.settings.SetInternalFeatureFlag("DISABLE_SHORTCUT_SUPPORT", true);
- Added new APIs for getting and setting parameter values on interactions, processors, and composites.
// Get parameter. action.GetParameterValue("duration"); // Any "duration" value on any binding. action.GetParameterValue("tap:duration"); // "duration" on "tap" interaction on any binding. action.GetParameterValue("tap:duration", // "duration" on "tap" on binding in "Gamepad" group. InputBinding.MaskByGroup("Gamepad")); // Set parameter. action.ApplyParameterOverride("duration", 0.4f); action.ApplyParameterOverride("tap:duration", 0.4f); action.ApplyParameterOverride("tap:duration", 0.4f, InputBinding.MaskByGroup("Gamepad")); // Can also apply parameter overrides at the level of // InputActionMaps and InputActionAssets with an effect // on all the bindings contained therein. asset.ApplyParameterOverride("scaleVector2:x", 0.25f, new InputBinding("<Mouse>/delta"));
Added
- Added support for "Hori Co HORIPAD for Nintendo Switch", "HORI Pokken Tournament DX Pro Pad", "HORI Wireless Switch Pad", "HORI Real Arcade Pro V Hayabusa in Switch Mode", "PowerA NSW Fusion Wired FightPad", "PowerA NSW Fusion Pro Controller (USB only)", "PDP Wired Fight Pad Pro: Mario", "PDP Faceoff Wired Pro Controller for Nintendo Switch", "PDP Faceoff Wired Pro Controller for Nintendo Switch", "PDP Afterglow Wireless Switch Controller", "PDP Rockcandy Wired Controller".
- Added support for SteelSeries Nimbus+ gamepad on Mac (addition contributed by Mollyjameson).
- Added support for Game Core platforms to XR layouts, devices, and input controls. These classes were previously only enabled on platforms where
ENABLE_VR
is defined. - Added a new
DeltaControl
control type that is now used for delta-style controls such asMouse.delta
andMouse.scroll
.- Like
StickControl
, this control has individualup
,down
,left
, andright
controls (as well asx
andy
that it inherits fromVector2Control
). This means it is now possible to directly bind to individual scroll directions (such as<Mouse>/scroll/up
).
- Like
- Added the 'Cursor Lock Behavior' setting to InputSystemUIInputModule to control the origin point of UI raycasts when the cursor is locked. This enables the use of PhysicsRaycaster when the cursor is locked to the center of the screen (case 1395281).
- Added support for using the Unity Remote app with the Input System.
- Requires Unity 2021.2.18 or later.