Giter Site home page Giter Site logo

unity-technologies / inputsystem Goto Github PK

View Code? Open in Web Editor NEW
1.4K 358.0 299.0 135.01 MB

An efficient and versatile input system for Unity.

License: Other

C# 98.91% Shell 0.01% PowerShell 0.03% ShaderLab 0.88% HLSL 0.11% Batchfile 0.01% Objective-C++ 0.05%
input events unity keyboard mouse touch vr xr devices gamepad

inputsystem's Introduction

Unity Input System (Package)

The Unity Input System package is an extension package to the Unity Platform which provides a system to configure game actions and access input devices to interact with Unity content. It is intended to be a more powerful, flexible, and configurable replacement to Unity Input API (the UnityEngine.Input class).

Prerequisites

The current version of the Input System requires Unity 2019 LTS, Unity 2020 LTS, Unity 2021 or Unity Beta (may be subject to instabilities) and included tooling to compile and run. The recommended way of installing Unity is via Unity Hub.

Getting Started

For instructions on how to get started using the Input System within Unity see Input System Manual - Installation.

Tutorials on how to use the Input System are available as part of:

  • Unity Learn - Using the Input System in Unity - Video tutorials on how to use the Input System in Unity.
  • Warriors Demo Project - A demo project illustrating a wide range of tools and features in the Input System, including local multi-player using different input methods.
  • Example projects part of this repository:
    • Custom Composite - Shows how to implement and register a custom InputBindingComposite.
    • Custom Device - Demonstrates how to add and author a custom device.
    • Custom Device Usages - An example of how to tag devices with custom "usages" and how to bind actions specifically to devices with only those usages.
    • Gamepad Mouse Cursor - An example of UI pointer navigation driven from gamepad input.
    • In-game Hints - Illustrates how to display text in the UI that involves action bindings as well as object interaction.
    • Input Recorder - Demonstrates how to use InputEventTrace and InputRecorder.
    • On-screen Controls - Demonstrates how to set up and use on-screen gamepad-like controls.
    • Rebinding UI - Demonstrates how to set up a rebinding UI to reconfigure bindings during run-time.
    • Simple Demo - Shows how to set up a simple character controller using actions, action asset as well as using the PlayerInput component.
    • Simple Multiplayer - Demonstrates a basic split-screen local multiplayer setup where players can join by pressing buttons on the supported devices to join the game.
    • UI vs Game Input - Illustrates how to handle input and resolve ambiguities that arise when overlaying UI elements in the game-view.
    • Visualizers - Provides various input data visualizations for common devices.

How to use a released versions of the package within a Unity project

All released versions of the Input System package are available via the Unity Package Manager, see Input System Manual - Installation for instructions how to fetch the package and compatible versions of samples and install them into your Unity project.

How to use the latest changes of the package in a Unity project

To test out the latest (unreleased) changes:

  1. Clone develop. The intention is to always keep the develop branch in a releasable state, but it reflects current development and may contain bugs or unexpected behavior that was not present in the latest released version.
  2. Add the local package to your project by following the steps described in Unity Manual - Installing a package from a local folder and select Packages/com.unity.inputsystem/package.json.

Recommended way of developing the Input System

  1. Clone develop or the desired branch or release tag.
  2. Open the root folder of the repository in the Unity Editor. This way you have access to tests and samples that are excluded when importing only the package into another Unity project.

During development, run Input System automated tests by selecting Window > General > Test Runner to access the Test Runner and select Run All for PlayMode or EditMode tests.

Contribution & Feedback

This project is developed by Unity Technologies but welcomes user contributions and feedback.

If you have any feedback or questions about Unity's Input System, you are invited to join us on the Unity Forums.

If you want to contribute to the development of the Input System see CONTRIBUTIONS.md for additional information.

License

This package is distributed under the Unity Companion License for Unity-dependent projects license with addition of third party licenses which applies to the Assets/Samples/RebindingUI example project specifically.

inputsystem's People

Contributors

alextyrer avatar andrew-oc avatar benoitalain avatar chris-massie avatar douglas-piconi avatar duckets avatar ekcoh avatar graham-huws avatar jackpr-unity avatar jamesmcgill avatar jechter avatar jfreire-unity avatar jiaunity avatar jimon avatar karljj1 avatar lyndon-unity avatar martinh-unity avatar mattdatwork avatar pauliusd01 avatar peterhall-unity3d avatar renedamm avatar ritamerkl avatar rytis-buz avatar secticide avatar staytalm avatar stefanunity avatar timkeo avatar todi1856 avatar tomekpaszek avatar yebata avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

inputsystem's Issues

Pointer deltas are always (0,0) in player/play mode.

The new state callback code that performs the OnCarryStateForward() logic does not check whether a given state has already been updated with a new event received in a different update. Thus the pointer delta reset logic may overwrite state that actually has the most up-to-date pointer state already in it.

When a TouchControl is finished, it's phase becomes "Ended" and stays that way. Should it eventually revert back to "None"?

I was testing Touchscreen by querying Touchscreen.current.touches. Per Rene's direction, valid touches have phase marked as something other than "None." After a touch is first recorded, it will never return to the "None" phase. Instead, when a touch is done it's phase will change to "Ended" and remain in that state. Is it designed that way, or should a touch's state eventually return to "None"?

Pointer deltas are too big

The accumulation logic has a bug that causes it to accumulate deltas from the previous frame into the current frame.

Xbox Controller

Hi,

Will this work with a standard Xbox Controller on a Xbox development Kit out the box?

Thanks
Jonathan

Rift devices doubling each restart

Running with the Rift on Win8 using XRUtilsForInputSystem fork and xr/sdk/input-subsystem so YMMV.

Repro Steps:

  1. Start app with Rift connected and Oculus enabled in VR Settings.
  2. Open up XRFT debugger.
  3. Play. Stop. Repeat.

Result:
Every time an entire new set of existing devices are added. First run you get 2, then 4 on second run, then 8 and so on.

Input Actions weird states

Create an Input Actions asset and setting it with certain empty parameters results in errors and invalid object states

(1) Having 1 action set with no actions and hitting "apply" results in a TreeView error related to having null children. The empty action set will be shown, but is not interact-able until you add a new set, which seems to overwrite the previous empty default set.
(2) Create only one action set and create an action with no bindings, then hit apply. Then delete the single action set. There is an error about an array property that has disappeared and pushing more GUIClips than you are popping. Scrolling the mouse wheel at this point results in the GUIClips error repeating. The Input Action Inspector UI also changes, with the layout changing slightly and "Imported Object" text appearing at the bottom of the UI.
(3) Create an action set, add a single action bound to "ByUsage/Accept" and hit apply. The "Generate C# Wrapper Class" checkbox and "revert" and "apply" buttons disappear. There is an error related to an operation not being valid due to the current state of the object. This seems to fire as the mouse is moved in and out of the Input Action inspector view, or when the mouse wheel is scrolled. At this stage, changing the single binding to, say, "gamepad/buttonEast" returns the wrapper class checkbox and revert/apply buttons, but the buttons are greyed out.

Can't remove modifier from action in Editor

Repro:

  1. Expose an action in the editor as a property.
  2. Bind a Control to the action and add a modifier (Tap in this case).
  3. Remove the modifier.

Result:
Lots of exceptions and can't remove modifier:

ArgumentNullException: Argument cannot be null.
Parameter name: source
System.Linq.Check.SourceAndSelector (System.Object source, System.Object selector)
System.Linq.Enumerable.Select[NameAndParameters,String] (IEnumerable1 source, System.Func2 selector)
ISX.Editor.InputBindingDrawer+ModifyPopupWindow.ApplyModifiers () (at Assets/InputSystem/InputSystem/Editor/InputBindingDrawer.cs:216)
ISX.Editor.InputBindingDrawer+ModifyPopupWindow.m__5 (UnityEditorInternal.ReorderableList list) (at Assets/InputSystem/InputSystem/Editor/InputBindingDrawer.cs:249)
UnityEditorInternal.ReorderableList+Defaults.DrawFooter (Rect rect, UnityEditorInternal.ReorderableList list) (at D:/repo/unity-isx/Editor/Mono/GUI/ReorderableList.cs:134)
UnityEditorInternal.ReorderableList.DoListFooter (Rect footerRect) (at D:/repo/unity-isx/Editor/Mono/GUI/ReorderableList.cs:640)
UnityEditorInternal.ReorderableList.DoList (Rect rect) (at D:/repo/unity-isx/Editor/Mono/GUI/ReorderableList.cs:412)
ISX.Editor.InputBindingDrawer+ModifyPopupWindow.OnGUI (Rect rect) (at Assets/InputSystem/InputSystem/Editor/InputBindingDrawer.cs:179)
UnityEditor.PopupWindow.OnGUI () (at D:/repo/unity-isx/Editor/Mono/GUI/PopupWindow.cs:92)
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:232)
System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MethodBase.cs:115)
UnityEditor.HostView.Invoke (System.String methodName, System.Object obj) (at D:/repo/unity-isx/Editor/Mono/HostView.cs:291)
UnityEditor.HostView.Invoke (System.String methodName) (at D:/repo/unity-isx/Editor/Mono/HostView.cs:284)
UnityEditor.HostView.OldOnGUI () (at D:/repo/unity-isx/Editor/Mono/HostView.cs:103)
UnityEngine.Experimental.UIElements.IMGUIContainer.DoOnGUI (UnityEngine.Event evt) (at D:/repo/unity-isx/Modules/UIElements/IMGUIContainer.cs:203)

NullReferenceException: Object reference not set to an instance of an object
ISX.Editor.InputBindingDrawer+ModifyPopupWindow.m__3 (Rect rect, Int32 index, Boolean isActive, Boolean isFocused) (at Assets/InputSystem/InputSystem/Editor/InputBindingDrawer.cs:233)
UnityEditorInternal.ReorderableList.DoListElements (Rect listRect) (at D:/repo/unity-isx/Editor/Mono/GUI/ReorderableList.cs:586)
UnityEditorInternal.ReorderableList.DoList (Rect rect) (at D:/repo/unity-isx/Editor/Mono/GUI/ReorderableList.cs:411)
ISX.Editor.InputBindingDrawer+ModifyPopupWindow.OnGUI (Rect rect) (at Assets/InputSystem/InputSystem/Editor/InputBindingDrawer.cs:179)
UnityEditor.PopupWindow.OnGUI () (at D:/repo/unity-isx/Editor/Mono/GUI/PopupWindow.cs:92)
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:232)
System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MethodBase.cs:115)
UnityEditor.HostView.Invoke (System.String methodName, System.Object obj) (at D:/repo/unity-isx/Editor/Mono/HostView.cs:291)
UnityEditor.HostView.Invoke (System.String methodName) (at D:/repo/unity-isx/Editor/Mono/HostView.cs:284)
UnityEditor.HostView.OldOnGUI () (at D:/repo/unity-isx/Editor/Mono/HostView.cs:103)
UnityEngine.Experimental.UIElements.IMGUIContainer.DoOnGUI (UnityEngine.Event evt) (at D:/repo/unity-isx/Modules/UIElements/IMGUIContainer.cs:203)
UnityEngine.DebugLogHandler:Internal_LogException(Exception, Object)
UnityEngine.DebugLogHandler:LogException(Exception, Object)
UnityEngine.Logger:LogException(Exception, Object)
UnityEngine.Debug:LogException(Exception)
UnityEngine.Experimental.UIElements.IMGUIContainer:DoOnGUI(Event) (at D:/repo/unity-isx/Modules/UIElements/IMGUIContainer.cs:214)
UnityEngine.Experimental.UIElements.IMGUIContainer:HandleIMGUIEvent(Event) (at D:/repo/unity-isx/Modules/UIElements/IMGUIContainer.cs:355)
UnityEngine.Experimental.UIElements.IMGUIContainer:HandleEvent(EventBase) (at D:/repo/unity-isx/Modules/UIElements/IMGUIContainer.cs:342)
UnityEngine.Experimental.UIElements.EventDispatcher:PropagateEvent(EventBase) (at D:/repo/unity-isx/Modules/UIElements/EventDispatcher.cs:451)
UnityEngine.Experimental.UIElements.EventDispatcher:DispatchEvent(EventBase, IPanel) (at D:/repo/unity-isx/Modules/UIElements/EventDispatcher.cs:322)
UnityEngine.Experimental.UIElements.UIElementsUtility:DoDispatch(BaseVisualElementPanel) (at D:/repo/unity-isx/Modules/UIElements/UIElementsUtility.cs:219)
UnityEngine.Experimental.UIElements.UIElementsUtility:ProcessEvent(Int32, IntPtr) (at D:/repo/unity-isx/Modules/UIElements/UIElementsUtility.cs:77)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr) (at D:/repo/unity-isx/Modules/IMGUI/GUIUtility.cs:184)

InputDebugger incorrectly shows data from remote Touchscreen

  • Ran application on Android
  • Connected Input Debugger
  • Produced some touches

See touchscreenremotedebugger

The position value is very weird, printing position on Android itself shows other values, phase value doesn't change at all, that means InputDebugger incorrectly display received data. (Maybe because it sends Delta event?)

Also InputDebugger gets stuck for 2-8 seconds after receiving 20-30 events.

Support plain USB devices on OSX

On OSX, supporting USB devices that aren't HIDs would allow talking to XInput devices without requiring 3rd party drivers (https://github.com/360Controller/360Controller). On Windows, we'd not gain as much by supporting straight USB but it might still be a nice thing to have (would allow talking to completely custom USB devices that aren't implementing any of the USB device class interfaces).

Meta and context menu keys don't report

ISX.Key ReportKey
Keyboard.current[ReportKey].value does not change when ReportKey is one of the meta keys or the context menu.

Should it? If not, should these enumerations simply be removed for user clarity?

Hitting "Apply" in .inputactions inspector leads to errors

UI gets corrupted (importer section disappears) and lots of exceptions logged to console. Some are InvalidOperationExceptions from ReadOnlyArray:

InvalidOperationException: Operation is not valid due to the current state of the object
ISX.Utilities.ReadOnlyArray1[ISX.InputBinding].get_Item (Int32 index) (at Packages/com.unity.inputsystem/InputSystem/Utilities/ReadOnlyArray.cs:94) ISX.InputActionSet+ActionJson.FromAction (ISX.InputAction action) (at Packages/com.unity.inputsystem/InputSystem/Actions/InputActionSet.cs:626) ISX.InputActionSet+ActionFileJson.FromSets (IEnumerable1 sets) (at Packages/com.unity.inputsystem/InputSystem/Actions/InputActionSet.cs:774)
ISX.InputActionSet.ToJson (IEnumerable`1 sets) (at Packages/com.unity.inputsystem/InputSystem/Actions/InputActionSet.cs:799)
ISX.InputActionAsset.ToJson () (at Packages/com.unity.inputsystem/InputSystem/Actions/InputActionAsset.cs:31)
ISX.Editor.InputActionImporterEditor.OnInspectorGUI () (at Packages/com.unity.inputsystem/InputSystem/Editor/InputActionImporterEditor.cs:108)
UnityEditor.InspectorWindow.DrawEditor (UnityEditor.Editor[] editors, Int32 editorIndex, Boolean rebuildOptimizedGUIBlock, System.Boolean& showImportedObjectBarNext, UnityEngine.Rect& importedObjectBarRect) (at X:/Unity/trunk/Editor/Mono/Inspector/InspectorWindow.cs:1364)
UnityEngine.DebugLogHandler:Internal_LogException(Exception, Object)
UnityEngine.DebugLogHandler:LogException(Exception, Object)
UnityEngine.Logger:LogException(Exception, Object)
UnityEngine.Debug:LogException(Exception)
UnityEditor.InspectorWindow:DrawEditor(Editor[], Int32, Boolean, Boolean&, Rect&) (at X:/Unity/trunk/Editor/Mono/Inspector/InspectorWindow.cs:1371)
UnityEditor.InspectorWindow:DrawEditors(Editor[]) (at X:/Unity/trunk/Editor/Mono/Inspector/InspectorWindow.cs:1138)
UnityEditor.InspectorWindow:OnGUI() (at X:/Unity/trunk/Editor/Mono/Inspector/InspectorWindow.cs:478)
System.Reflection.MonoMethod:InternalInvoke(Object, Object[], Exception&)
System.Reflection.MonoMethod:Invoke(Object, BindingFlags, Binder, Object[], CultureInfo) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)
System.Reflection.MethodBase:Invoke(Object, Object[]) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MethodBase.cs:115)
UnityEditor.HostView:Invoke(String, Object) (at X:/Unity/trunk/Editor/Mono/HostView.cs:295)
UnityEditor.HostView:Invoke(String) (at X:/Unity/trunk/Editor/Mono/HostView.cs:288)
UnityEditor.HostView:InvokeOnGUI(Rect) (at X:/Unity/trunk/Editor/Mono/HostView.cs:255)
UnityEditor.DockArea:OldOnGUI() (at X:/Unity/trunk/Editor/Mono/GUI/DockArea.cs:386)
UnityEngine.Experimental.UIElements.IMGUIContainer:DoOnGUI(Event) (at X:/Unity/trunk/Modules/UIElements/IMGUIContainer.cs:199)
UnityEngine.Experimental.UIElements.IMGUIContainer:HandleIMGUIEvent(Event) (at X:/Unity/trunk/Modules/UIElements/IMGUIContainer.cs:364)
UnityEngine.Experimental.UIElements.IMGUIContainer:DoRepaint(IStylePainter) (at X:/Unity/trunk/Modules/UIElements/IMGUIContainer.cs:72)
UnityEngine.Experimental.UIElements.Panel:PaintSubTree(Event, VisualElement, Matrix4x4, ClippingOptions, Rect) (at X:/Unity/trunk/Modules/UIElements/Panel.cs:726)

Binding an action to a button control detects button press twice for each single press

Repro:

  1. Bind an action to a button control (in my case, this happened with Oculus and OpenVR A/B Buttons).
  2. In the action query if the button was just pressed.
void OnButtonAction(InputAction.CallbackContext context)
        {
            var buttonControl = context.control as ButtonControl;
            if (buttonControl != null && buttonControl.wasJustPressed)
            {
              // this code is reached twice for each button press
            }
        }

Expected:
Single press detected in action when polling wasJustPressed.

Move and look action on SimpleController can drift

In the action-based version of SimpleController, the "move" and "look" action can create drift by leaving m_Look and m_Move at non-zero values even after the stick has moved back into rest position.

wasJustPressed and wasJustReleased stick

Based on our discussion in this issue: #49

Expected: Keyboard.current.aKey.wasJustPressed functions equivalently to Input.GetButtonDown, Keyboard.current.aKey.wasJustReleased functions equivalently to Input.GetButtonUp.
Observed: wasJustPressed and wasJustReleased stick. WasJustPressed will continue to be true every Update loop as a key is held down. WasJustReleased will continue to be true after a key is depressed until it is pressed again.

I presume this happens because wasJustPressed and wasJustReleased directly check state, and state is only updated on a physical control update.

Noisy devices make .current useless

The PS4 controller, for example, due to its built-in accelerometer and gyro, will constantly spam HID input reports. This means that as long as it is connected, it will have input events pretty much in every update. This in turn means that MakeCurrent() is called on the gamepad all the time.

So if you have, say, an XInput controller and a PS4 controller connected and you want to play with the XInput controller and have the PS4 controller just sit there, Gamepad.current will constantly be interfered with by the PS4 controller.

Unfortunately, even if we check whether the state of the device has actually changed (and not just whether it has received an event at all), this will help with the problem only as long as we don't include the noisy controls in the state. As soon as we pick up the accelerometer and gyro from the PS4 controller as normal controls, they'll be in the state and thus change all the time.

My guess is that a proper solution would require explicitly marking noisy controls and excluding them from checks related to "did we get input here?"

I think this could be efficiently implemented by keeping one copy of the state around with all non-noisy controls set to all 1s and all noisy controls set to all 0s. If we AND both the old and the new state with it and then do a memcmp, we should be able to tell whether any "meaningful" controls have changed.

Windows Mixed Reality/HoloLens support

Are there any plans to integrate HoloLens/Windows MR support into this system?

As I understand it now, adding a new input device like that requires changes on the native side, is that right?
If that's the case, will there be a possibility to add such functionality via a plugin or some hypothetical extension API into this project without requiring Unity to make any changes?

Crash on Windows Editor during HID device creation

Hi,

I have a 100% crash in

>	Unity.exe!win::HIDInputThreadState::OpenDevice(win::HIDInputThreadState::HIDDevice & device) Line 1385	C++	Symbols loaded.
 	Unity.exe!win::HIDInputThreadState::CheckForDeviceAddsAndRemovals() Line 1470	C++	Symbols loaded.
 	Unity.exe!win::HIDInputThread(void * __formal) Line 1526	C++	Symbols loaded.
 	Unity.exe!Thread::RunThreadWrapper(void * ptr) Line 36	C++	Symbols loaded.
 	kernel32.dll!00007ffa57031fe4()	Unknown	Non-user code. Cannot find or open the PDB file.
 	ntdll.dll!00007ffa5723efb1()	Unknown	Non-user code. Cannot find or open the PDB file.

 device.GetInputStateEvent().deviceId = device.deviceId() <---
 device.GetInputStateEvent() is NULL

dumping fields:

-		descriptor	{capabilities={vendorId=255 productId=47820 usage=14 ...} }	InputDeviceDescriptorWithCapabilities<HIDInputDeviceCapabilities>
-		InputDeviceDescriptor	{interfaceName="HID" type="" product="Virtual Multitouch Device" ...}	InputDeviceDescriptor
+		interfaceName	"HID"	core::basic_string<char,core::StringStorageDefault<char> >
+		type	""	core::basic_string<char,core::StringStorageDefault<char> >
+		product	"Virtual Multitouch Device"	core::basic_string<char,core::StringStorageDefault<char> >
+		manufacturer	"DJP Inc."	core::basic_string<char,core::StringStorageDefault<char> >
+		serial	"123123123"	core::basic_string<char,core::StringStorageDefault<char> >
+		version	"1"	core::basic_string<char,core::StringStorageDefault<char> >
+		capabilities	{vendorId=255 productId=47820 usage=14 ...}	HIDInputDeviceCapabilities


-		device	{deviceId=13 devicePath="L"\\\\?\\hid#hidclass&col03#1&2d595ca7&1&0002#{4d1e55b2-f16f-11cf-88cb-001111000030}"" ...}	win::HIDInputThreadState::HIDDevice &
+		InputDeviceCallbacks	{...}	InputDeviceCallbacks
		deviceId	13	int
+		devicePath	"L"\\\\?\\hid#hidclass&col03#1&2d595ca7&1&0002#{4d1e55b2-f16f-11cf-88cb-001111000030}""	core::basic_string<wchar_t,core::StringStorageDefault<wchar_t> >
		deviceInstance	33	unsigned long
		fileHandle	0x0000000000002650	void *
		preparsedData	0x0000000183fe1460 {...}	_HIDP_PREPARSED_DATA *
		inputEvent	0xffffffffffffffff	void *
		outputEvent	0xffffffffffffffff	void *
+		inputOverlapped	{Internal=0 InternalHigh=0 Offset=0 ...}	_OVERLAPPED
+		outputOverlapped	{Internal=0 InternalHigh=0 Offset=0 ...}	_OVERLAPPED
		inputReportSize	0	int
+		inputBuffer	{size = 0}	dynamic_array<char,0>
+		outputBuffer	{size = 0}	dynamic_array<char,0>

It appears the device in question here is a multitouch monitor.

Cannot interact with UI using a mouse or keyboard

This is true in Windows Editor playmode and in Windows Standalone Player builds.

Tested UnityEngine.UI button, dropdown, slider, scrollbar, and inputfield.

This is a duplicate of Ono PR issue 31176. Moving it here so all bugs are visible in one place, per our recent conversation.

Exceptions when using Input Debugger window

I've gotten quite a few of these while using the Rift Touch controllers and trying to view input debugger information. No exact repro steps but it seems to happen fairly often if I transfer a project with bindings between machines (for example: save a project bound to Rift controllers at home and then open the same project at work and try to use with other Touch controllers). In addition to exceptions the debugger window for the controller is collapsed and not useful.

ndexOutOfRangeException: Array index is out of range.
ISX.Utilities.InlinedArray1[System.Action1[ISX.LowLevel.InputEventPtr]].Remove (System.Action1 value) (at Assets/InputSystem/InputSystem/Utilities/InlinedArray.cs:87) ISX.InputManager.remove_onEvent (System.Action1 value) (at Assets/InputSystem/InputSystem/InputManager.cs:82)
ISX.InputSystem.remove_onEvent (System.Action`1 value) (at Assets/InputSystem/InputSystem/InputSystem.cs:282)
ISX.LowLevel.InputEventTrace.Disable () (at Assets/InputSystem/InputSystem/Events/InputEventTrace.cs:69)
ISX.Editor.InputDeviceDebuggerWindow.DrawEventList () (at Assets/InputSystem/InputSystem/Editor/InputDeviceDebuggerWindow.cs:159)
ISX.Editor.InputDeviceDebuggerWindow.OnGUI () (at Assets/InputSystem/InputSystem/Editor/InputDeviceDebuggerWindow.cs:96)
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:232)
System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MethodBase.cs:115)
UnityEditor.HostView.Invoke (System.String methodName, System.Object obj) (at D:/repo/unity-isx/Editor/Mono/HostView.cs:291)
UnityEditor.HostView.Invoke (System.String methodName) (at D:/repo/unity-isx/Editor/Mono/HostView.cs:284)
UnityEditor.HostView.InvokeOnGUI (Rect onGUIPosition) (at D:/repo/unity-isx/Editor/Mono/HostView.cs:251)
UnityEngine.DebugLogHandler:Internal_LogException(Exception, Object)
UnityEngine.DebugLogHandler:LogException(Exception, Object)
UnityEngine.Logger:LogException(Exception, Object)
UnityEngine.Debug:LogException(Exception)

HID elements in descriptors sent from native are not in the right order

ATM we infer the byte and bit offset of a HID control from the order in which it appears in the HID descriptor of the device. This is the same as it works on the driver level (offsets are implicit instead of explicit). However, this depends on us getting those elements in the exact same order as they appear initially on the device. Both OSX and Windows mess with this by neither preserving that order nor by making offsets/indices available explicitly.

I'm trying to figure out a way where we can reconstruct the order or the offset of an element from what we have in the OSX and the Windows API.

Note that this issue is only relevant for the generic HID case where we take a device we don't know about specifically and just go by its raw descriptor. For HIDs where we have a product-specific template in place (like XboxGamepadOSX), everything is working fine as the descriptor is simply ignored.

Will not build in release mode

Due to #if statements, the compiler complains about missing functions. See attached screenshot. This may also be the root of Ono PR issue 31213

Only the most recent touch is reported

Expected Behavior: Multiple touches are reported independently in Touchscreen.current.touches.
Observed Behavior: The most recent touch is reported in Touchscreen.current.touches[0]. All other touches are not reported.

You can observe this behavior using the QA touch test scene in Assets/QA/Tests/Touch/ISX_Touch.unity.
This scene is a part of this PR: #33

Keyboard keys not reporting accurately

Pressing this key on keyboard > causes InputSystem to report this key

Numpad + > Numpad -
Numpad - > Numpad *
Numpad * > Numpad /
Numpad / > Numpad =

I don't yet have a keyboard with a numpad equals sign. Will update when I find one.

Console spam with newer MacBook Pros

It seems that the touchpad in newer MBPs is sending massive HID input reports which are exceeding the current 1k limit on native input events. This leads to the native system rejecting the events and logging errors to the console.

We want two things here:

  1. Ability to send larger input events. Instead of just increasing the max size, one interesting idea would be to automatically slice larger state events into smaller delta events.
  2. Ability to turn off devices. We're not interested in the reports from the touchpad. The device should simply be turned off under the control of the C# system.

Mouse Pointer Offset

On my 3440x1440 screen, putting the mouse in the upper right corner of the screen reports a position of (-7.0, -7.0) in the Input Debugger Pointer. This also occurs on my 2560x1440 screen. Will report what happens after reboot...

Support key bindings to generate Vector2s on input actions

ATM you can't really set up a "move" action that expects a Vector2 with WASD-style keyboard bindings. Instead, you'd have to have separate "moveLeft", "moveRight", "moveForward", and "moveBackward" actions for when individual move direction are needed.

What's missing is the ability for modifiers on actions to alter the value reported on the action. Right now, if you do ctx.GetValue<Vector2>() in the action callback, it'll go right through to the control that triggered the action and try to fetch a Vector2 value from it.

If this was more decoupled, a "move" action could simply have "Keyboard A", "Keyboard D", "Keyboard W", and "Keyboard S" bindings and then have a modifier on each binding that simply takes a specified 2D vector and scales it with the float value of the KeyControl. E.g. "Keyboard A" would have an associated vector (-1,0) so if "A" is not pressed, it'd scale the vector to (-0,0) and if it is pressed, it'd return (-1,0) as is.

Aside from figuring out how that fits into the machinery, there's also the question of how this handles concurrent input. If both "A" and "W" are pressed, the vector needs to be (-1,1), i.e. a combination of the vector (-1,0) from "A" and the vector (0,1) from "W".

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.