You need something that loads and uses a DLL. The DLL by itself is not going to run. We need some more information regarding how this library will be used. You can create a library that has only processing classes/functions, but somewhere the keyboard will have to be monitored.
Here is a post that discusses global keyboard monitoring. The answer of that question links out to an MSDN article.
Back to what I initially mentioned, you do not need to have the actual events in your library. You can create a library containing only functional code. That code could then be called from a higher level in the overall application where the events are handled. Here is a very simplistic, and honestly hackish, example:
public static class MyKeyboardActions
{
public void HandleKeyCharPress(char keyPressed)
{
switch(keyPressed)
{
case 'A':
// do code for key: A
break;
case 'B':
// do code for key: B
break;
// etc...
}
}
}
If you want something more specific than this, you would need to elaborate more about your project in your question, then I can expand my answer more if needed. As you can see though, there is no need for a System.Windows.Forms
reference with that code.