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

keyListener in java  RSS feed

 
Rishi Yagnik
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello all
I want to implement a right click menu(context sensitive menu functionality from key board)i have done it through mouse pls any body how can i do it with the keyboard i have see all the constants in KeyEvent but nothing seems to be there for right click button in keyboard.
pls help required immed..
Rishi
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ummm... you can't right-click a keyboard... You would have to assign a specific key press to launch the menu... I would make it possible to launch the menu with either a mouse click or key press by having a method that shows the menu, and have this method be called by both the mouselistener and the keylistener...
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!