A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Joined: Mar 21, 2008
May 28, 2008 08:32:00
quick question: how can I find out when the key F12 is pressed? (and of course do something when it is pressed?)
Joined: Mar 22, 2005
May 28, 2008 08:51:00
Assuming that this is AWT or Swing code, you'd add a KeyListener and trigger on KeyEvent.VK_F12 in one of its methods.
Joined: Oct 27, 2005
May 29, 2008 12:38:00
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
subject: Catching F12
Problems interrupting a thread
Show all/Jump to method in IntelliJ
Sending a "Function Key" Message in JS
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2015