| Версия для печати темы
Нажмите сюда для просмотра этой темы в оригинальном формате |
| Форум программистов > Java: Общие вопросы > Эмуляция событий от мыши и клавиатуры |
| Автор: AntonSaburov 2.11.2004, 13:02 |
| За предоставленную информацию огромное спасибо Kurt Используйте класс Robot. Он предоставляет такие методы, как Color getPixelColor(int x, int y) - Returns the color of a pixel at the given screen coordinates. void keyPress(int keycode) - Presses a given key. void keyRelease(int keycode) - Releases a given key. void mouseMove(int x, int y) - Moves mouse pointer to given screen coordinates. void mousePress(int buttons) - Presses one or more mouse buttons. void mouseRelease(int buttons) - Releases one or more mouse buttons. void mouseWheel(int wheelAmt) - Rotates the scroll wheel on wheel-equipped mice. |