• Post Reply Bookmark Topic Watch Topic
  • New Topic

KeyListener for a button?

 
Gulshan Singh
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a button that performs some action when its clicked, but I also want to have the same thing performed when the button is in focus and the user presses enter. I've looked into keybindings and keylisteners and I just can't get it to work so can someone give me an example of how to do this? If you get a button in focus and press space, it works, but I want that same affect for the enter key.
 
Rob Camick
Ranch Hand
Posts: 2699
10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Enter Key and Button
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!