Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

KeyListener for a button?  RSS feed

 
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: 2800
15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Enter Key and Button
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!