dotnet / dotnet/Silk.NET

Multiple Keyboard/HID support.

Open
#2,006 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
C#
Stars
5.2k
Forks
477
Avg merge
3d 16h
Merged PRs (30d)
2

Description

Support using multiple keyboard and other HID devices independently from each other.

The input API already has a keyboard index API but at least on Windows it's always zero. The raw keyboard API provides ways to get various information about the source device for a Windows keypress event. This includes enough information to have a non-zero index value as well as vendor+product id so it's possible to identify exactly what device it is.

I don't know how to do this in other operating systems but it should be possible. I would like to avoid adding something platform dependent in my application which is why I suggest this as a feature in SILK, hiding away the specific platform API for doing this.

Note that the online examples for using the windows raw keyboard API from C# doesn't pin the struct between registering and unregistering for raw keyboard notifications. This randomly makes the application stop receiving raw keyboard notifications which is rather annoying. Also not unregistering properly leads to a kernel memory leak like many other Windows API:s so don't do that.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.