简体   繁体   English

指定对操作系统的按键事件的深度*-Java AWT Robot

[英]Specify depth* of key press event to OS - Java AWT Robot

I have a program, which by using the java Robot class, sends key strokes to the operating system. 我有一个程序,该程序通过使用java Robot类将击键发送到操作系统。
I was wondering to what depth* of the OS does the class send the strokes? 我想知道班级将笔画发送到操作系统的哪个深度*?

For instance, are they sent to the lowest possible level (hardware), so the computer believes the key was physically pressed, or are they sent to the highest possible level - to the applications with keyboard focus. 例如,将它们发送到尽可能低的级别(硬件),以便计算机认为按键被物理按下,或者将它们发送到尽可能高的级别-具有键盘焦点的应用程序。
They mustn't be notably low level, since I've noticed that the key strokes aren't registered by Windows MouseKeys - they pass through as if MouseKeys were not active. 它们一定不能太低,因为我注意到Windows的MouseKeys并没有注册按键-它们像MouseKey处于未激活状态一样经过。

I can't find any specification of the depth; 我找不到关于深度的任何说明。 only "they are sent to the Operating System" 仅“将它们发送到操作系统”

I was also wondering if it were possible to pass the intended depth of the keystroke in the OS to the robot class somehow? 我还想知道是否可以通过某种方式将操作系统中按键的预期深度传递给机器人类?

I apologize if any of this is vague; 如果其中任何内容含糊,我深表歉意。 I have little knowledge of how Key Events actually work! 我对关键事件的实际运作方式知之甚少!

Thanks! 谢谢!

Actually the inputs are sent to the OS, the OS redirects the input to the application in the foreground. 实际上,输入已发送到OS,OS将输入重定向到前台的应用程序。 You can switch between windows using JNA ( java sending keystrokes using robot class ). 您可以使用JNA(在Java中使用机械手类发送击键 )在窗口之间切换。 Hopefully this help someone. 希望这可以帮助某人。

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

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