![]() ![]() When a device is added, the Input System automatically issues a sync request on the device. InputSystem.AddDevice(new InputDeviceDescription ![]() Add a device such that the matching process is employed: This bypasses the matching process and creates a device directly ![]() To add devices manually, you can call one of the InputSystem.AddDevice methods such as InputSystem.AddDevice(layout). Once added, the InputDevice.added flag is set to true. The Input System also calls InputDevice.OnAdded. As part of this process, the Input System calls MakeCurrent on the Device, and signals InputDeviceChange.Added on InputSystem.onDeviceChange. Use this to finalize the setup of the Controls.Īfter an InputDevice is fully assembled, the Input System adds it to the system. To guide the creation process, you must use layouts.Īfter the Input System assembles the InputDevice, it calls FinishSetup on each control of the device and on the device itself. Note: You can't create valid InputDevices and InputControls by manually instantiating them with new. This process is internal and happens automatically. Once the system has chosen a layout for a device, it instantiates an InputDevice and populates it with InputControls as the layout dictates. If your handler returns a non-null layout string, then the Input System uses this layout. To do this, add a custom handler to the InputSystem.onFindControlLayoutForDevice event. This also makes it possible to quickly build new layouts. You can overrule the internal matching process from outside to select a different layout for a Device than the system would normally choose. ![]() If multiple matchers are matching the same InputDeviceDescription, the Input System chooses the matcher that has the larger number of properties to match against. Register an alternate matcher for an already registered layout. Register a new layout and supply a matcher for it. You can also supply them when you register a layout. To matchers to any layout, call InputSystem.RegisterLayoutMatcher. For a matcher to apply, all of its individual expressions have to match. Each field in the description can be independently matched with either a plain string or regular expression. Each matcher loosely functions as a kind of regular expression. InputDeviceMatcher instances handle matching an InputDeviceDescription to a registered layout. WebGL, Android, and Linux use similar mechanisms to report available Controls on connected gamepads. Examples of interface-specific Device capabilities are HID descriptors. Not all Device interfaces report Device capabilities. This string describes characteristics which help the Input System to interpret the data from a Device, and map it to Control representations. See the section on capabilities.Īside from a number of standardized fields, such as product and manufacturer, a Device description can contain a capabilities string in JSON format. If available, provides the serial number for the Device.Ī string in JSON format that describes Device/interface-specific capabilities. If available, provides the version of the driver or hardware for the Device. Name of the manufacturer as reported by the Device/driver itself. Name of the product as reported by the Device/driver itself. In many cases, this corresponds to the name of the platform, but there are several more specific interfaces that are commonly used: HID, RawInput, XInput.Ī broad categorization of the Device. Identifier for the interface/API that is making the Device available. This process is based on Device matchers.Īfter a Device has been created, you can retrieve the description it was created from through the scription property.Įvery description has a set of standard fields: Field Based on the description, the system then attempts to find a Device layout that matches the description. When a new Device is reported (by the runtime or by the user), the report contains a Device description. The Input System uses this primarily during the Device discovery process. Device descriptionsĪn InputDeviceDescription describes a Device. To query the set of all currently present Devices, you can use vices. See supported Devices to see what kind of Devices the Input System currently supports. The InputDevice class is itself a specialization of InputControl. Logically, Input Devices are the top-level container for Controls. Physically, Input Devices represent devices attached to the computer, which a user can use to control the app. ![]()
0 Comments
Leave a Reply. |