title: How to simulate function key (enable FN key) press
body: <p>I am trying to simulate my function keys, however, the KeyEvent class does not have a name for the function enable key. I tried this <a href="https://docs.oracle.com/javase/tutorial/displayCode.html?code=https://docs.oracle.com/javase/tutorial/uiswing/examples/events/KeyEventDemoProject/src/events/KeyEventDemo.java" rel="nofollow noreferrer">program</a>, but it didn't give me any name of what the function key is. </p>
  
  <p>My code for pressing the key:</p>
  
  <pre><code>package myCode;
  
  import java.awt.*;
  import java.awt.event.KeyEvent;
  public class KeyboardLights {
      public static void main(String[] args) {
          try {
              Robot r = new Robot();
              int keyCodeFn = KeyEvent.VK_F; // Don't know what the FN key is
              int keyCode = KeyEvent.VK_F4;
              r.keyPress(keyCodeFn);
              r.keyPress(keyCode);
              r.keyRelease(keyCodeFn);
              r.keyRelease(keyCode);
          } catch (AWTException e) {
              e.printStackTrace();
          }
      }
  }
  </code></pre>
  
  <p>I can't find any "FN" key in the keyevent page, so does anyone know how I can simulate the FN enable key</p>
  
  <p>It is regarding the FN key in the bottom left corner:</p>
  
  <p><a href="https://i.stack.imgur.com/zliLI.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/zliLI.png" alt="enter image description here"></a></p>