title: Key Board shortcut for moving mouse cursor (num pad) i.e a,6,2,8... are not working with java robot class
body: <p>We can use Keyboard shortcut of num pad i.e </p>
  
  <pre><code>4-left 6-right 2-down 8-up 
  </code></pre>
  
  <p>for scrolling mouse cursor without using mouse.</p>
  
  <p>By enabling </p>
  
  <blockquote>
    <p>Control Panel\Ease of Access\Ease of Access Center\Make the mouse easier to use</p>
  </blockquote>
  
  <p>But it is not working with java robot class - it simply <strong>prints</strong> number i.e 4/6/2/8 on screen.</p>
  
  <p>Any idea what might be the problem?</p>
  
  <p>Code:</p>
  
  <pre><code>import javax.swing.*;
  import java.awt.*;
  import java.awt.event.*;
  import java.util.logging.Level;
  import java.util.logging.Logger;
  class MoveCursor 
  {
      public static void main(String[] args)
      {
          try {
              Robot r=new Robot();
               r.keyPress(KeyEvent.VK_NUMPAD4);
               r.delay(4000);
               r.keyRelease(KeyEvent.VK_NUMPAD4);
          } catch (AWTException ex) {
  </code></pre>
  
  <p>Logger.getLogger(MoveCursor.class.getName()).log(Level.SEVERE, null, ex);
              }
          }
      }</p>