From 06ae42ec1898841cc5cf02c9b8129675ae1636bf Mon Sep 17 00:00:00 2001 From: Nathan Date: Sun, 7 Jul 2024 09:22:52 -0600 Subject: [PATCH] v0.4.0 --- Packages/com.thenathannator.hidrogen/CHANGELOG.md | 12 ++++++++++++ Packages/com.thenathannator.hidrogen/README.md | 11 +++++++++++ Packages/com.thenathannator.hidrogen/package.json | 2 +- README.md | 4 ++-- 4 files changed, 26 insertions(+), 3 deletions(-) diff --git a/Packages/com.thenathannator.hidrogen/CHANGELOG.md b/Packages/com.thenathannator.hidrogen/CHANGELOG.md index 6aad29f..c12ca96 100644 --- a/Packages/com.thenathannator.hidrogen/CHANGELOG.md +++ b/Packages/com.thenathannator.hidrogen/CHANGELOG.md @@ -6,6 +6,18 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), Dates are relative to UTC. +## [0.4.0] - 2024/07/07 + +### Added + +- A new backend has been implemented to re-introduce XInput device support on Unity 2022.2 and onward. + - Just about all functionality provided by the native backend in 2022.1 and earlier is supported in this new backend, so all layouts built for it will work here. + - Gamepad devices are ignored by this backend, as they will still be handled by the native backend through Windows.Gaming.Input. + +### Fixed + +- The GameInput backend no longer consumes excessive amounts of CPU due to not actually performing any thread sleeps. + ## [0.3.1] - 2024/06/22 ### Fixed diff --git a/Packages/com.thenathannator.hidrogen/README.md b/Packages/com.thenathannator.hidrogen/README.md index 5afe319..2b268fa 100644 --- a/Packages/com.thenathannator.hidrogen/README.md +++ b/Packages/com.thenathannator.hidrogen/README.md @@ -15,6 +15,8 @@ An add-on for the [Unity InputSystem](https://github.com/Unity-Technologies/Inpu - [Xbox One Controllers on Windows via GameInput](#xbox-one-controllers-on-windows-via-gameinput) - [Dependencies](#dependencies-1) - [Notes](#notes) + - [XInput Backend on Windows for Unity 2022.2+](#xinput-backend-on-windows-for-unity-20222) + - [Notes](#notes-1) - [License](#license) ## Usage @@ -75,6 +77,15 @@ This backend depends on GameInput being installed on the user's system. Although - As of the time of writing, the GameInput function that is responsible for sending raw output reports is not currently implemented. All output commands will silently fail until it gets implemented. (Only the `E_NOTIMPL` HRESULT is treated as success, all others will be logged and generate a proper failure code.) - Gamepads reported through GameInput are ignored, to ensure no duplicate devices will occur between GameInput and XInput. +### XInput Backend on Windows for Unity 2022.2+ + +This backend reintroduces XInput support to Unity 2022.2 and onward; starting from 2022.2 they switched to Windows.Gaming.Input for gamepad support. All existing XInput layouts and commands are supported through this backend, except for gamepads, which will be handled by the native backend already and are ignored. + +#### Notes + +- This backend will only enable itself in Unity 2022.2 and onward. No special setup is needed for it. +- This backend does not respect the `InputSystem.pollingFrequency` setting currently, it uses a hard-set sleep time of 1 ms. + ## License This project is licensed under the MIT license. See [LICENSE.md](LICENSE.md) for details. diff --git a/Packages/com.thenathannator.hidrogen/package.json b/Packages/com.thenathannator.hidrogen/package.json index 9e1266c..025bf40 100644 --- a/Packages/com.thenathannator.hidrogen/package.json +++ b/Packages/com.thenathannator.hidrogen/package.json @@ -1,6 +1,6 @@ { "name": "com.thenathannator.hidrogen", - "version": "0.3.1", + "version": "0.4.0", "displayName": "HIDrogen", "description": "An add-on for the Unity InputSystem package that provides proper HID device support on Linux.", "unity": "2019.4", diff --git a/README.md b/README.md index 70544d3..fc4762a 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,7 @@ See the [Unity documentation](https://docs.unity3d.com/Manual/upm-git.html) for #### Via URL 1. Open the Unity Package Manager and hit the + button, then select `Add package from git URL`. -2. Paste in `https://github.com/TheNathannator/HIDrogen.git?path=/Packages/com.thenathannator.hidrogen#v0.3.1` and hit Add. +2. Paste in `https://github.com/TheNathannator/HIDrogen.git?path=/Packages/com.thenathannator.hidrogen#v0.4.0` and hit Add. To update, increment the version number at the end of the URL to the new version number and repeat these steps with the new URL. Alternatively, you can edit the URL listed in your `manifest.json` file as described in the [Via Manifest](#via-manifest) section. @@ -49,7 +49,7 @@ In your Packages > `manifest.json` file, add the following line to your `depende ```diff { "dependencies": { -+ "com.thenathannator.hidrogen": "https://github.com/TheNathannator/HIDrogen.git?path=/Packages/com.thenathannator.hidrogen#v0.3.1" ++ "com.thenathannator.hidrogen": "https://github.com/TheNathannator/HIDrogen.git?path=/Packages/com.thenathannator.hidrogen#v0.4.0" } } ```