Packages
 In this topic

*Constructors

*Methods

*Fields

 

Packages   PreviousThis PackageNext
Package com.ms.ui.event   Previous This
Package
Next

 


Class UIInputEvent

public abstract class UIInputEvent extends UIEvent
{
  // Fields
  public static final int ALT_MASK;
  public static final int BUTTON1_MASK;
  public static final int BUTTON2_MASK;
  public static final int BUTTON3_MASK;
  public static final int CTRL_MASK;
  public static final int META_MASK;
  public static final int SHIFT_MASK;

  // Constructors
  public UIInputEvent(IUIComponent source,int id,long when,
        int modifiers);

  // Methods
  public boolean consume();
  public int getModifiers();
  public long getWhen();
  public boolean isAltDown();
  public boolean isConsumed();
  public boolean isControlDown();
  public boolean isMetaDown();
  public boolean isShiftDown();
}

This is the root event class for all component-level input events. Input events are delivered to listeners before they are processed normally by the source where they originated. This allows listeners and component subclasses to consume the event so that the source will not process them in their default manner. All of the constant values defined match the AWT event definitions.

UIInputEvent also allows a Listener to "consume" an input (key or mouse) event before passing it to the underlying UIComponent.

Also see consume, UIinputEvent

EventObject
  |
  +--UIBaseEvent
    |
    +--UIEvent
      |
      +--UIInputEvent

Constructors

UIInputEvent

public UIInputEvent(IUIComponent source,int id,long when, int modifiers);

Creates a UIInputEvent object with the specified source IUIComponent, modifiers, and type.

ParameterDescription
source The object where the event originated.
id The event type.
when The time the event occurred.
modifiers The modifier keys down while event occurred.

Methods

consume

public boolean consume();

Consumes the input event so its not processed by the underlying IUIComponent. This is implemented for the UIEdit control. Key and mouse events may also be consumed by other com.ms.ui components, but not always consistently. This is because some components pass events to other, underlying components, which handle the event.

Return Value:

Returns true if the event is not passed to the underlying component.

See Also: isConsumed

getModifiers

public int getModifiers();

Retrieves the modifiers flag of the event.

Return Value:

Returns the modifiers flag of the event. This can be one or a combination of the following.
SHIFT_MASK CTRL_MASK META_MASK ALT_MASK
BUTTON1_MASK BUTTON2_MASK BUTTON3_MASK

getWhen

public long getWhen();

Retrieves the timestamp of the event.

Return Value:

Returns the timestamp of the event.

isAltDown

public boolean isAltDown();

Returns whether the ALT key is pressed for this event.

Return Value:

Returns true if the ALT key is pressed.

isConsumed

public boolean isConsumed();

Determines the current consume state of the input event.

Return Value:

Returns true if the event is not passed to the underlying component; otherwise, returns false.

See Also: consume

isControlDown

public boolean isControlDown();

Returns whether the CTRL key is pressed for this event.

Return Value:

Returns true if the CTRL key is pressed.

isMetaDown

public boolean isMetaDown();

Returns whether the Meta modifier is pressed for this event.

Return Value:

Returns true if the Meta modifier is pressed.

isShiftDown

public boolean isShiftDown();

Determines whether the SHIFT key is pressed for this event.

Return Value:

Returns true if the SHIFT key is pressed.

Fields

ALT_MASK
The ALT key modifier constant.
BUTTON1_MASK
The left mouse button modifier constant.
BUTTON2_MASK
The right mouse button modifier constant.
BUTTON3_MASK
The third mouse button modifier constant.
CTRL_MASK
The CONTROL key modifier constant.
META_MASK
The Meta key modifier constant.
SHIFT_MASK
The SHIFT key modifier constant.

upnrm.gif © 1998 Microsoft Corporation. All rights reserved. Terms of use.