Гость
Целевая тема:
Создать новую тему:
Автор:
Форумы / Java [игнор отключен] [закрыт для гостей] / имитировать нажатие клавиш юзером / 8 сообщений из 8, страница 1 из 1
17.08.2004, 13:15
    #32652698
имитировать нажатие клавиш юзером
Всем Привет!
У меня вопрос:
Как можно имитировать нажатие клавиш юзером (под windows) в коде, так чтобы другая программа поймала и отреагировала, на пример на сочетание клавиш ctrl+enter или alt+s.

Я знаю что это возможно, но как не знаю.
Помогите пожалуйста кто может - очень важно для проекта.

Спасибо
...
Рейтинг: 0 / 0
Период между сообщениями больше года.
15.09.2005, 10:19
    #33270442
GlukOza
Участник
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
имитировать нажатие клавиш юзером
Поднимаю тоже вопрос. А все же как?
...
Рейтинг: 0 / 0
15.09.2005, 10:23
    #33270464
GlukOza
Участник
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
имитировать нажатие клавиш юзером
Или, другое, как обработать пункт меню программой ...
...
Рейтинг: 0 / 0
15.09.2005, 10:26
    #33270471
имитировать нажатие клавиш юзером
java.awt.Robot


/**
* This class is used to generate native system input events
* for the purposes of test automation, self-running demos, and
* other applications where control of the mouse and keyboard
* is needed. The primary purpose of Robot is to facilitate
* automated testing of Java platform implementations.
* <p>
* Using the class to generate input events differs from posting
* events to the AWT event queue or AWT components in that the
* events are generated in the platform's native input
* queue. For example, <code>Robot.mouseMove</code> will actually move
* the mouse cursor instead of just generating mouse move events.
* <p>
* Note that some platforms require special privileges or extensions
* to access low-level input control. If the current platform configuration
* does not allow input control, an <code>AWTException</code> will be thrown
* when trying to construct Robot objects. For example, X-Window systems
* will throw the exception if the XTEST 2.2 standard extension is not supported
* (or not enabled) by the X server.
* <p>
* Applications that use Robot for purposes other than self-testing should
* handle these error conditions gracefully.
*
* @version 1.27, 12/19/03
* @author Robi Khan
* @since 1.3
*/
...
Рейтинг: 0 / 0
15.09.2005, 10:27
    #33270481
имитировать нажатие клавиш юзером
GlukOzaИли, другое, как обработать пункт меню программой ...
программой...
...
Рейтинг: 0 / 0
15.09.2005, 10:42
    #33270530
GlukOza
Участник
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
имитировать нажатие клавиш юзером
гость из прошлого GlukOzaИли, другое, как обработать пункт меню программой ...
программой...

Вы не проснулись? Извините...
...
Рейтинг: 0 / 0
15.09.2005, 11:00
    #33270604
имитировать нажатие клавиш юзером
GlukOzaВы не проснулись? Извините...

Проснулся! Извинения принимаются!
...
Рейтинг: 0 / 0
15.09.2005, 11:20
    #33270668
GlukOza
Участник
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
имитировать нажатие клавиш юзером
выбирающий солнечное утроjava.awt.Robot


/**
* This class is used to generate native system input events
* for the purposes of test automation, self-running demos, and
* other applications where control of the mouse and keyboard
* is needed. The primary purpose of Robot is to facilitate
* automated testing of Java platform implementations.
* <p>
* Using the class to generate input events differs from posting
* events to the AWT event queue or AWT components in that the
* events are generated in the platform's native input
* queue. For example, <code>Robot.mouseMove</code> will actually move
* the mouse cursor instead of just generating mouse move events.
* <p>
* Note that some platforms require special privileges or extensions
* to access low-level input control. If the current platform configuration
* does not allow input control, an <code>AWTException</code> will be thrown
* when trying to construct Robot objects. For example, X-Window systems
* will throw the exception if the XTEST 2.2 standard extension is not supported
* (or not enabled) by the X server.
* <p>
* Applications that use Robot for purposes other than self-testing should
* handle these error conditions gracefully.
*
* @version 1.27, 12/19/03
* @author Robi Khan
* @since 1.3
*/


Спасибо за подсказку. Интересный пакет ~))
...
Рейтинг: 0 / 0
Форумы / Java [игнор отключен] [закрыт для гостей] / имитировать нажатие клавиш юзером / 8 сообщений из 8, страница 1 из 1
Найденые пользователи ...
Разблокировать пользователей ...
Читали форум (0):
Пользователи онлайн (0):
x
x
Закрыть


Просмотр
0 / 0
Close
Debug Console [Select Text]