title: How do I use low-level 8 bit flags as conditionals?
body: <p>In my keyboard hook, each keypress gets a flag that states if it was injected or not. 
  <a href="http://msdn.microsoft.com/en-us/library/ms644967(VS.85).aspx" rel="noreferrer">http://msdn.microsoft.com/en-us/library/ms644967(VS.85).aspx</a></p>
  
  <p>I've distilled a KBDLLHOOKSTRUCT from the lParam. I can access kbd.flags.XXX. I just don't know how to convert this 8bit flag into an <code>if (injected) {...</code> type conditional that I know how to use.</p>
  
  <p>If one of you smart computer-science types would help me out I'd really appreciate it.</p>
  
  <pre><code>    private static IntPtr HookCallback(int nCode, IntPtr wParam, IntPtr lParam)
      {
          KBDLLHOOKSTRUCT kbd = new KBDLLHOOKSTRUCT();
          Marshal.PtrToStructure(lParam, kbd);
  
          //if (injected) {...
  </code></pre>
  
  <p>Cheers!</p>