-
1 Attachment(s)
Keyboard Testing
Add the class to your project, create a button on your form and bung this code in... Run the program hold down the LEFT control key and click the button :D
Code:
private void button1_Click(object sender, System.EventArgs e)
{
if(KeyTester.KeyIsDownNow(KeyTester.Key.LCONTROL))
MessageBox.Show("Left Control is pressed!");
}
Check out the KeyTester.Key enumeration to see all the available testable keys.
There are two other methods in this class for testing if a key is not pressed or if a key is toggled.
*Updated Again*, is now game quality :D
-
Re: Keyboard Testing
And change it to this will maybe make it compile too...;)
Code:
private void button1_Click(object sender, System.EventArgs e)
{
if(KeyTester.KeyIsDownNow(KeyTester.Key.LCONTROL))
MessageBox.Show("Left Control is pressed!");
}