• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 191
  • Last Modified:

ActionEvent - accelerator key OR menu item cilcked?

public void actionPerformed(ActionEvent e)
  {

how do i know if a menu action was fired by the user clicking the menu item, or by using an accelerator key??  note that the accelerator key is DELETE, so i cannot check for modifier keys like ctrl, alt, shift!!

thanks
0
cathalmchale
Asked:
cathalmchale
  • 2
2 Solutions
 
objectsCommented:
afaik you can't
0
 
objectsCommented:
why should it make a difference?
0
 
girionisCommented:
You can *probably* capture the DELETE key if you have a KeyEvent. Then you could do something like:

int keycode = keyEvent.getKeycode();
if (keycode == KeyEvent.VK_DELETE)
{
    // blah blah
}
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now