Monday, February 3, 2014

Caps Lock Status Displaying

import java.awt.*;
import java.awt.event.*;
class statuscaps
{
   public static void main(String args[])
   {
      boolean status = Toolkit.getDefaultToolkit().getLockingKeyState(KeyEvent.VK_CAPS_LOCK);
      if(status)
         System.out.println("You Caps Lock is on");
      else
         System.out.println("You Caps Lock is off");
   }
}

No comments:

Post a Comment