This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Catching F12  RSS feed

 
Sam Benry
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
quick question: how can I find out when the key F12 is pressed? (and of course do something when it is pressed?)
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Assuming that this is AWT or Swing code, you'd add a KeyListener and trigger on KeyEvent.VK_F12 in one of its methods.
 
Rob Spoor
Sheriff
Posts: 21087
85
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't think you can catch it in a command line application. Rather than the application catching it, the shell or command window will catch it, and not pass it to the app.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!