I can’t figure out how get this method to work:
System.Windows.Input.Keyboard.IsKeyDown(System.Windows.Input.Key)
The object browser says
IsKeyDown is static, so you need to use it like
Keyboard.IsKeyDown()
Not with an instantiated object.
You also need to make sure you have the correct using statement at the top:
using System.Windows.Input;
EDIT
On further inspection, Keyboard is a static class... So you can't Keyboard test = new Keyboard();
Add PresentationCore.dll
assembly as a reference.
Add WindowsBase.dll
assembly as a reference.
Test code:
private void buttonMisc_Click(object sender, EventArgs e)
{
if (System.Windows.Input.Keyboard.IsKeyDown(System.Windows.Input.Key.LeftShift) == true)
MessageBox.Show("Got it!");
}