title: How to write a program that intercepts input before it reaches the kernel?
body: <p>There is this program <em>install-interception.exe</em>, which can be downloaded from here: <a href="http://www.oblita.com/interception.html" rel="nofollow">http://www.oblita.com/interception.html</a></p>
  
  <p>It intercepts any kind of input, before it reaches the kernel. It allows me, for example, to differentiate between multiple keyboards on windows-level. Anyway, this is a very handy program, but I have no idea how it works. This is all I can find about the source code: <a href="https://github.com/oblitum/Interception/issues/5" rel="nofollow">https://github.com/oblitum/Interception/issues/5</a></p>
  
  <p>So I'm using something I don't understand so, I want to ask if you can point me into the direction of how to write a c/c++ program of how to do the same.</p>
  
  <p><strong>Edit:</strong></p>
  
  <p>I thought I might as well describe what I use this program for.
  Using this input-interceptor, I've written a program that allows me to do the following:
  I have one main keyboard, and one macro keyboard. The main keyboard works normally, but the macro keyboard has a few extra features.
  These features are are activated by pressing a button on the macro keyboard, what buttons do what are decided by an XML file that is loaded when the program starts. These are the features:</p>
  
  <ul>
  <li>Insert text</li>
  <li>Enable/disable keyboard input capture + write input to file</li>
  <li>Copy to clipboard 1/2/3, etc</li>
  <li>Paste from clipboard 1/2/3, etc</li>
  <li>Run program (Example, start chrome, run batch files)</li>
  <li>Find next instance of program X/Y/Z, and put it on the screen. For example: Find next instance of "Visual Studio" and put it on the front screen. Basically an Alt-Tab replacement.</li>
  <li>Put stickers on macro keyboard buttons so I can easily identify what each button does :D :D</li>
  </ul>
  
  <p>Basically I wrote this very handy program with the interception API, but I don't know how the input is intercepted before it is passed to the API, I want to learn how, so I can more completely understand my program.</p>