1

I have a program, which by using the java Robot class, sends key strokes to the operating system.
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.

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!

4

1 に答える 1

0

実際には、入力は OS に送信され、OS は入力をフォアグラウンドのアプリケーションにリダイレクトします。JNAを使用してウィンドウを切り替えることができます(Javaはロボットクラスを使用してキーストロークを送信します)。うまくいけば、これは誰かを助けます。

于 2014-08-13T22:27:54.110 に答える