FileDocCategorySizeDatePackage
InputEvent.javaAPI DocAndroid 1.5 API5339Wed May 06 22:41:54 BST 2009java.awt.event

InputEvent

public abstract class InputEvent extends ComponentEvent
This class is not supported in Android 1.0. It is merely provided to maintain interface compatibility with desktop Java implementations.
since
Android 1.0

Fields Summary
private static final long
serialVersionUID
public static final int
SHIFT_MASK
public static final int
CTRL_MASK
public static final int
META_MASK
public static final int
ALT_MASK
public static final int
ALT_GRAPH_MASK
public static final int
BUTTON1_MASK
public static final int
BUTTON2_MASK
public static final int
BUTTON3_MASK
public static final int
SHIFT_DOWN_MASK
public static final int
CTRL_DOWN_MASK
public static final int
META_DOWN_MASK
public static final int
ALT_DOWN_MASK
public static final int
BUTTON1_DOWN_MASK
public static final int
BUTTON2_DOWN_MASK
public static final int
BUTTON3_DOWN_MASK
public static final int
ALT_GRAPH_DOWN_MASK
private static final int
DOWN_MASKS
private long
when
private int
modifiersEx
Constructors Summary
InputEvent(Component source, int id, long when, int modifiers)

        super(source, id);

        this.when = when;
        modifiersEx = extractExFlags(modifiers);
    
Methods Summary
public voidconsume()

        super.consume();
    
static intextractExFlags(int modifiers)

        int exFlags = modifiers & DOWN_MASKS;

        if ((modifiers & SHIFT_MASK) != 0) {
            exFlags |= SHIFT_DOWN_MASK;
        }
        if ((modifiers & CTRL_MASK) != 0) {
            exFlags |= CTRL_DOWN_MASK;
        }
        if ((modifiers & META_MASK) != 0) {
            exFlags |= META_DOWN_MASK;
        }
        if ((modifiers & ALT_MASK) != 0) {
            exFlags |= ALT_DOWN_MASK;
        }
        if ((modifiers & ALT_GRAPH_MASK) != 0) {
            exFlags |= ALT_GRAPH_DOWN_MASK;
        }
        if ((modifiers & BUTTON1_MASK) != 0) {
            exFlags |= BUTTON1_DOWN_MASK;
        }
        if ((modifiers & BUTTON2_MASK) != 0) {
            exFlags |= BUTTON2_DOWN_MASK;
        }
        if ((modifiers & BUTTON3_MASK) != 0) {
            exFlags |= BUTTON3_DOWN_MASK;
        }

        return exFlags;
    
public intgetModifiers()

        int modifiers = 0;

        if ((modifiersEx & SHIFT_DOWN_MASK) != 0) {
            modifiers |= SHIFT_MASK;
        }
        if ((modifiersEx & CTRL_DOWN_MASK) != 0) {
            modifiers |= CTRL_MASK;
        }
        if ((modifiersEx & META_DOWN_MASK) != 0) {
            modifiers |= META_MASK;
        }
        if ((modifiersEx & ALT_DOWN_MASK) != 0) {
            modifiers |= ALT_MASK;
        }
        if ((modifiersEx & ALT_GRAPH_DOWN_MASK) != 0) {
            modifiers |= ALT_GRAPH_MASK;
        }
        if ((modifiersEx & BUTTON1_DOWN_MASK) != 0) {
            modifiers |= BUTTON1_MASK;
        }
        if ((modifiersEx & BUTTON2_DOWN_MASK) != 0) {
            modifiers |= BUTTON2_MASK;
        }
        if ((modifiersEx & BUTTON3_DOWN_MASK) != 0) {
            modifiers |= BUTTON3_MASK;
        }

        return modifiers;
    
public intgetModifiersEx()

        return modifiersEx;
    
public static java.lang.StringgetModifiersExText(int modifiers)


        /*Ex*/ 
        return MouseEvent.addMouseModifiersExText(
                KeyEvent.getKeyModifiersExText(modifiers), modifiers);
    
public longgetWhen()

        return when;
    
public booleanisAltDown()

        return ((modifiersEx & ALT_DOWN_MASK) != 0);
    
public booleanisAltGraphDown()

        return ((modifiersEx & ALT_GRAPH_DOWN_MASK) != 0);
    
public booleanisConsumed()

        return super.isConsumed();
    
public booleanisControlDown()

        return ((modifiersEx & CTRL_DOWN_MASK) != 0);
    
public booleanisMetaDown()

        return ((modifiersEx & META_DOWN_MASK) != 0);
    
public booleanisShiftDown()

        return ((modifiersEx & SHIFT_DOWN_MASK) != 0);
    
voidsetModifiers(int modifiers)

        modifiersEx = extractExFlags(modifiers);