This article shows how to check it out wheather the Keyboard CapsLock,NumLock,ScrollLock On/OFF and also toggle the caps lock
private void Form1_Load(object sender, EventArgs e) { if (Control.IsKeyLocked(Keys.CapsLock)) { listBox1.Items.Add("CapsLock ON"); } else { listBox1.Items.Add("CapsLock OFF"); }
if (Control.IsKeyLocked(Keys.NumLock)) { listBox1.Items.Add("NumLock ON"); } else { listBox1.Items.Add("NumLock OFF"); }
if (Control.IsKeyLocked(Keys.Scroll)) { listBox1.Items.Add("ScrollLock ON"); } else { listBox1.Items.Add("ScrollLock OFF"); }
}
private void button1_Click(object sender, EventArgs e) { keybd_event(0x14, 0x45, KEYEVENTF_EXTENDEDKEY, (UIntPtr)0); keybd_event(0x14, 0x45, KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP, (UIntPtr)0); }
For more details, visit
|
No responses found. Be the first to respond and make money from revenue sharing program.
|