Avalonia icon indicating copy to clipboard operation
Avalonia copied to clipboard

Get input device identity

Open mateli opened this issue 5 months ago • 3 comments

Is your feature request related to a problem? Please describe.

When using multiple input devices of the same kind (for example two usb keyboards) Avalonia has no way of determinate which device caused the keyboard event.

Describe the solution you'd like

To obtain device information on Windows RegisterRawInputDevices can be used. Then the resulting windows event will contain a handle to the device and further information can be obtained using GetRawInputDeviceList and GetRawInputDeviceInfo. Note that when modern windows variant locks they actually perform a desktop switch mess up the above device registration so it has to be registered again. In my current WPF code I reregister on various system events to get around this.

I don't know how to obtain similar information on other platforms and this has to be properly abstracted to be useful on multiple platforms.

Describe alternatives you've considered

No response

Additional context

No response

mateli avatar Aug 26 '24 13:08 mateli