aspose file tools*
The moose likes Beginning Java and the fly likes Catching F12 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Catching F12" Watch "Catching F12" New topic
Author

Catching F12

Sam Benry
Ranch Hand

Joined: Mar 21, 2008
Posts: 89
quick question: how can I find out when the key F12 is pressed? (and of course do something when it is pressed?)
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42916
    
  68
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

Joined: Oct 27, 2005
Posts: 19783
    
  20

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.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Catching F12