Generate a low level system event.
post
is used to generate low level keyboard and mouse events. The intent is to enable automated UI testing by simulating the input from the user. Most SWT applications should never need to call this method.
Note that this operation can fail when the operating system fails to generate the event for any reason. For example, this can happen when there is no such key or mouse button or when the system event queue is full.
Event Types:
KeyDown, KeyUp
The following fields in the Event
apply:
- (in) type KeyDown or KeyUp
Either one of:
- (in) character a character that corresponds to a keyboard key
- (in) keyCode the key code of the key that was typed, as defined by the key code constants in class
SWT
MouseDown, MouseUp
The following fields in the Event
apply:
- (in) type MouseDown or MouseUp
- (in) button the button that is pressed or released
MouseMove
The following fields in the Event
apply:
- (in) type MouseMove
- (in) x the x coordinate to move the mouse pointer to in screen coordinates
- (in) y the y coordinate to move the mouse pointer to in screen coordinates
MouseWheel
The following fields in the Event
apply:
- (in) type MouseWheel
- (in) detail either SWT.SCROLL_LINE or SWT.SCROLL_PAGE
- (in) count the number of lines or pages to scroll
@param event the event to be generated
@return true if the event was generated or false otherwise
@exception IllegalArgumentException
- ERROR_NULL_ARGUMENT - if the event is null
@exception SWTException
- ERROR_DEVICE_DISPOSED - if the receiver has been disposed
@since 3.0