Determining which keyboard is sending keystrokes

后端 未结 5 874
梦如初夏
梦如初夏 2021-01-22 12:04

I have 2 keyboards hooked up to my machine (one on PS/2, the other on USB). How would I determine which keyboard is sending the keystrokes in C#?

5条回答
  •  执念已碎
    2021-01-22 12:36

    Here's a sample, very dirty code, showing how to use windows input hook from .NET. Works best with Snippet Compiler :>

    EDIT: turns out there's a length limit for posts,

    grab the source from code here

    .

提交回复
热议问题