I tried using this post here: Using global keyboard hook (WH_KEYBOARD_LL) in WPF / C# And i have this sucessfully working.
But there is something i cant get my finger behind. It can detect every single key pressed, but i like to make my app do something on a key combination.
void KListener_KeyDown(object sender, RawKeyEventArgs args)
{
Console.WriteLine(args.Key.ToString());
if (args.Key == Key.LeftCtrl && args.Key == Key.C)
{
MessageBox.Show(args.Key.ToString());
}
}
Obvious, this does not work, as the void only is for every single key (if i understand correct)
So i really need some help to get it working for a key combination, for example Ctrl + C could someone push me in the right direction here ?