RawInputLight 1.1.6

dotnet add package RawInputLight --version 1.1.6
                    
NuGet\Install-Package RawInputLight -Version 1.1.6
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="RawInputLight" Version="1.1.6" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="RawInputLight" Version="1.1.6" />
                    
Directory.Packages.props
<PackageReference Include="RawInputLight" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add RawInputLight --version 1.1.6
                    
#r "nuget: RawInputLight, 1.1.6"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package RawInputLight@1.1.6
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=RawInputLight&version=1.1.6
                    
Install as a Cake Addin
#tool nuget:?package=RawInputLight&version=1.1.6
                    
Install as a Cake Tool

RawInputLight

This is an absolutely minimal wrapper around Win32 RawInpuit in order to get Mouse, KB and Joystick/gamepad input.

It uses a hidden background window to collect the information and works no matter what window has focus. It is built for .NET 6 and talks directly to the Win32API. As such, it does NOT depened on any Windows desktop framework (WPF, WinForms, etc)

It is pure C# and, for the most part, depends on the CsWin32 code generator to create the PInvoke stubs on the fly. CsWin32 generates binding code on the fly from the list in NativeMethods.txt A small number of manual PInvokes are defined in NativeAPI.CS, along with the all native glue code, for when I couldnt coax PInvoke into generating soemthing I needed.

On Rider, you may have to clear the caches to get it to update the PInvoke's correctly, especially if you change NativeMethods.txt

This release is functioning, see the test app for usage. Callbacks in this version return the HANDLE for the device reporting data. You can get the product and manufacture names with the call NativeAPI.GetDeviceNames(<handle>) The code for getting those names is borrowed from the rawinput-sharp project. (https://github.com/mfakane/rawinput-sharp)

Note that names are cached by handle. I dont expect handles to change their meaning during program execution, but if they do you can regenerate the names by manually calling NativeAPI.RefreshDeviceNames()

Note the HID usages provided in the callbacks are the full usage, including the high bits that indicate the usage page.

Release Notes:

1.1.0 - refactored the code for improved performance and cleanliness. Also put more information in DeviceInfo

1.1.1 - Added NativeAPI.GetDevices

1.1.2 - Fixed WNDPROC gc issue

1.1.3 - Updated Keyboard and Mouse DeviceInfo to create "fake" UsagePage and Usage info

1.1.5 - Bug fixes and converted single callbacks to events for multiplexing

1.1.6 - bug fix in input handling

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net6.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.1.6 226 2/14/2024
1.1.5 503 12/17/2021
1.1.3 359 12/16/2021
1.1.2 359 12/16/2021
1.1.1 365 12/16/2021
1.1.0 373 12/15/2021
1.0.1 335 12/14/2021
1.0.0 360 12/13/2021