سؤال

Is there a way to simulate key strokes in java? For example:

I start k.jar, and after

Thread.wait(10000);

without pressing any keys, the program will simulate that the user is typing.

I'm also interested in mouse movement and clic simulation.

Thanks!

هل كانت مفيدة؟

المحلول

Try Robot, which is a built-in class that facilitates automated keyboard/mouse interaction.

It can fire mouse and keyboard actions, and get information about pixels on the screen.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top