I'm making an app that will control my rgb lights and I want it to handle event for clicking specific key, but i want to run it as a background process.
I have already tried using this:
private void Form1_Load(object sender, EventArgs e)
{
this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.Form1_KeyDown);
}
private void Form1_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
{
if (e.KeyCode == Keys.F9)
{
Debug.WriteLine("F9 down");
}
}
It works, but only if form window is active and visible, so I'm not satisfied. I'm looking for a solution that will work even if the form is invisible.