title: C# Hooking specific Keyboard keystroke and stop system propagation
body: <p>I have an application where I have multiple keyboards connected through USB.</p>
  <p>I need to hook a <strong>specific</strong> keyboard to get the keypress directly into the software, even if this one is not on the foreground. This so far works based on <a href="https://www.codeproject.com/Articles/17123/Using-Raw-Input-from-C-to-handle-multiple-keyboard" rel="nofollow noreferrer">this project</a>. The other keyboards shall work as normal.</p>
  <p>Although it seems by using Direct Input, it is not possible to stop propagation (we don't want other apps to get that particular keyboard input).</p>
  <p>Concerning Global Hook, it can block the keypress system-wise, but it is impossible, as far as I know, to identify the source of the keystroke (which keyboard it is from) and thus to selectively block them.</p>
  <p>There is another project, <a href="https://www.codeproject.com/Articles/716591/Combining-Raw-Input-and-keyboard-Hook-to-selective" rel="nofollow noreferrer">here</a>, that combines the two, but it is quite messy and heavy.</p>
  <p>Is there a better way to achieve this? I am surprised that simple task is so complex.</p>