title: Handle shortcut key event from keyboard in javafx
body: <p>My code is:</p>
  
  <pre><code>if(mBooleanLoginDone==true)
  {
      mMenuItemProdType.setAccelerator(new KeyCodeCombination(KeyCode.T, KeyCombination.CONTROL_DOWN, KeyCodeCombination.SHORTCUT_DOWN));
  }
  else
  {
     System.out.println("Not Loggged In");
  } 
  </code></pre>
  
  <p>In Above code mBooleanLoginDone is a Boolean variable indicating where the user logged in or not. I want shortcut key <kbd>Ctrl</kbd>+<kbd>T</kbd> to work only when user successfully logged in but right now I'm not logged in and shortcut key is also working. How can I solve it any idea?</p>