简体   繁体   English

Java:KeyListener

[英]Java: KeyListener

I was just wondering if it was possible to add a key listener to components outside a java application. 我只是想知道是否可以向Java应用程序外部的组件添加键侦听器。 In other words, what do I need to do in order to detect the keys typed when the focus isn't on the java application? 换句话说,当焦点不在Java应用程序上时,我需要做什么来检测键入的键?

Thanks in advance, 提前致谢,

S. S.

Unfortunately, you can't detect key events to programs running outside of your Java application. 不幸的是,您无法检测到在Java应用程序外部运行的程序的关键事件。 It you want to do that, you'll have to write your program in a native language (C, C++, etc.) 如果要这样做,则必须使用本机语言(C,C ++等)编写程序

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM