title: Alt Gr key gives menu focus when I don't expect it to
body: <p>Several keyboards have a <a href="https://en.wikipedia.org/wiki/AltGr_key" rel="nofollow">Alt Gr key</a>. On my Swedish keyboard layout, to enter the <code>[</code> character I have to press <kbd>Alt Gr</kbd> + <kbd>8</kbd> (or <kbd>Ctrl</kbd> + <kbd>Alt</kbd> + <kbd>8</kbd>).</p>
  
  <p>If I were to input this character <em>twice</em> in a JavaFX <code>TextField</code>, where the application also has a <code>MenuBar</code>, the menu bar keeps the focus instead of the text field. This makes me have to press <kbd>Alt</kbd> or <kbd>Alt Gr</kbd> again to make the <code>TextField</code> get focus. I'd want the <code>TextField</code> to have focus after I enter any character with the <kbd>Alt Gr</kbd> key.</p>
  
  <p><strong>Code to reproduce problem:</strong></p>
  
  <pre><code>public class MenuTest extends Application {
      @Override
      public void start(Stage primaryStage) throws Exception {
          Pane pane = new VBox();
  
          MenuBar menuBar = new MenuBar();
          menuBar.getMenus().add(new Menu("_File"));
          menuBar.getMenus().add(new Menu("_Test"));
  
          TextField input = new TextField();
  
          pane.getChildren().add(menuBar);
          pane.getChildren().add(input);
  
          Scene scene = new Scene(pane);
          primaryStage.setScene(scene);
          primaryStage.show();
      }
  
      public static void main(String[] args) {
          launch(args);
      }
  }
  </code></pre>
  
  <p><strong>Steps to reproduce:</strong></p>
  
  <p>With the <code>TextField</code> having focus do:</p>
  
  <ul>
  <li>With your keyboard layout set to Swedish, press <kbd>Alt Gr</kbd> + <kbd>8</kbd> (or <kbd>Ctrl</kbd> + <kbd>Alt</kbd> + <kbd>8</kbd>) twice. For other keyboard layouts, enter any character of your choice that includes the usage of the <kbd>Alt Gr</kbd> key.</li>
  <li>Press left arrow</li>
  </ul>
  
  <p><strong>Expected behavior:</strong> Two <code>[</code> characters are inserted into the <code>TextField</code>. Caret is moved one step to the left in the <code>TextField</code>.</p>
  
  <p><strong>Actual behavior:</strong> Two <code>[</code> characters are inserted into the <code>TextField</code>. Another menu is highlighted and has focus</p>
  
  <p><strong>Question:</strong></p>
  
  <p>Why is this happening? Even Windows' basic Notepad application behaves according to my expectations here.</p>
  
  <p>Is there any way I can make the actual behavior match the expected behavior?</p>