using System;
using System.Runtime.InteropServices;
using System.Text;
namespace ConsoleApplication8{
class Class1{
[STAThread]
static void Main(string[] args){
// Display current status of keys.
Console.WriteLine(
"**BEFORE**/r/nCAP: {0}/r/nSCR: {1}/r/nNUM: {2}",
Keyboard.GetState(VirtualKeys.VK_CAPITAL)?"ON":"OFF",
Keyboard.GetState(VirtualKeys.VK_SCROLL)?"ON":"OFF",
Keyboard.GetState(VirtualKeys.VK_NUMLOCK)?"ON":"OFF"
);
// Toggle all the keys:
Keyboard.SetState(
VirtualKeys.VK_CAPITAL,
!Keyboard.GetState(VirtualKeys.VK_CAPITAL)
);
Keyboard.SetState(
VirtualKeys.VK_SCROLL,
!Keyboard.GetState(VirtualKeys.VK_SCROLL)
);
Keyboard.SetState(
VirtualKeys.VK_NUMLOCK,
!Keyboard.GetState(VirtualKeys.VK_NUMLOCK)
);
// Display new status of keys.
Console.WriteLine(