I'm trying to get the key pressed on the keyboard (not a specific), i watched somes "solutions" everywhere and i found nothing working. Conditions: Need anchoring a panel on the form.
This worked on a Console, i want the same without cancelling it! https://learn.microsoft.com/en-us/dotnet/api/System.Console.CancelKeyPress?view=net-6.0
private void Form1_KeyPress(object sender, KeyPressEventArgs e) { KeysConverter convertor = new KeysConverter(); string keyPressed = convertor.ConvertToString(e.KeyChar); if (keyPressed == "t") { Console.WriteLine("THIS IS T"); } }