I want to make background code that checks if someone hit "H","D", or other letters. Like This,(I mean a background code that is checking this.)
if(e.KeyCode == Keys.U)
{
code;
}
I want to make background code that checks if someone hit "H","D", or other letters. Like This,(I mean a background code that is checking this.)
if(e.KeyCode == Keys.U)
{
code;
}
In WinForms you can override onKeyDown() like so:
protected override void onKeyDown(KeyEventArgs e)
{
if (e.KeyCode == Keys.YourKey)
{
// Do something
}
}
Where you substitute YourKey with desired key from Keyboard. (You can use intellisense to see all available options)