title: Is it possible to swallow a key in Raw Input?
body: <p>I am using the <strong><a href="http://msdn.microsoft.com/en-us/library/windows/desktop/ms645536%28v=vs.85%29.aspx" rel="noreferrer">Raw Input API</a></strong> because I need to be able to respond to keys from different USB HID devices differently, even if it is the same key.</p>
  
  <p>My window receives the <code>WM_INPUT</code> messages correctly. I can retrieve the <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/ms645575%28v=vs.85%29.aspx" rel="noreferrer"><code>RAWKEYBOARD</code> structure</a> to obtain all the information I need.</p>
  
  <p>Now I want to prevent those USB devices from being able to toggle NumLock. I am hoping that the Raw Input API might allow me to swallow the NumLock keypress?</p>
  
  <p>I’ve tried setting the WM_INPUT message’s Result to 1, but that doesn’t seem to have an effect.</p>
  
  <p>(I am writing this in C#, but since this is all low-level Windows API, you probably don’t need knowledge of C# or .NET to answer this.)</p>
  
  <p>EDIT: Oh yeah, I’ve also tried using a global keyboard hook (<code>SetWindowsHookEx</code>) to swallow the NumLock keypress. Unfortunately, as soon as I initialize the Raw Input API, the global keyboard hook is no longer called while the window is active. I’ve also tried setting the global hook <em>after</em> the Raw Input one, but same effect.</p>