I am trying to detect which keyboard is pressed in a console application when there are more than one keyboard inputs.
if there are two keyboards like laptops default keyboard and wireless keyboard is attached in my case if I press any key on any keyboard it shows this.key is press but I need this.key from this keyboard is pressed
in this code, it detects only the key
public class Program
{
public static void Main()
{
ConsoleKeyInfo keyinfo;
do
{
keyinfo = Console.ReadKey();
Console.WriteLine(keyinfo.Key + " was pressed" + );
}
while (keyinfo.Key != ConsoleKey.X);
}
}