java.awt.event

Class InputEvent

Implemented Interfaces:
Serializable
Known Direct Subclasses:
KeyEvent, MouseEvent

public abstract class InputEvent
extends ComponentEvent

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. For example, consuming mousePressed events on a Button component will prevent the Button from being activated.
Since:
1.1
See Also:
KeyEvent, KeyAdapter, MouseEvent, MouseAdapter, MouseMotionAdapter, Serialized Form

Field Summary

static int
ALT_DOWN_MASK
The Alt key extended modifier constant.
static int
ALT_GRAPH_DOWN_MASK
The AltGraph key extended modifier constant.
static int
ALT_GRAPH_MASK
The AltGraph key modifier constant.
static int
ALT_MASK
The Alt key modifier constant.
static int
BUTTON1_DOWN_MASK
The Mouse Button1 extended modifier constant.
static int
BUTTON1_MASK
The Mouse Button1 modifier constant.
static int
BUTTON2_DOWN_MASK
The Mouse Button2 extended modifier constant.
static int
BUTTON2_MASK
The Mouse Button2 modifier constant.
static int
BUTTON3_DOWN_MASK
The Mouse Button3 extended modifier constant.
static int
BUTTON3_MASK
The Mouse Button3 modifier constant.
static int
CTRL_DOWN_MASK
The Control key extended modifier constant.
static int
CTRL_MASK
The Control key modifier constant.
static int
META_DOWN_MASK
The Meta key extended modifier constant.
static int
META_MASK
The Meta key modifier constant.
static int
SHIFT_DOWN_MASK
The Shift key extended modifier constant.
static int
SHIFT_MASK
The Shift key modifier constant.

Fields inherited from class java.awt.event.ComponentEvent

COMPONENT_FIRST, COMPONENT_HIDDEN, COMPONENT_LAST, COMPONENT_MOVED, COMPONENT_RESIZED, COMPONENT_SHOWN

Fields inherited from class java.awt.AWTEvent

ACTION_EVENT_MASK, ADJUSTMENT_EVENT_MASK, COMPONENT_EVENT_MASK, CONTAINER_EVENT_MASK, FOCUS_EVENT_MASK, HIERARCHY_BOUNDS_EVENT_MASK, HIERARCHY_EVENT_MASK, INPUT_METHOD_EVENT_MASK, INVOCATION_EVENT_MASK, ITEM_EVENT_MASK, KEY_EVENT_MASK, MOUSE_EVENT_MASK, MOUSE_MOTION_EVENT_MASK, MOUSE_WHEEL_EVENT_MASK, PAINT_EVENT_MASK, RESERVED_ID_MAX, TEXT_EVENT_MASK, WINDOW_EVENT_MASK, WINDOW_FOCUS_EVENT_MASK, WINDOW_STATE_EVENT_MASK, consumed, id

Fields inherited from class java.util.EventObject

source

Method Summary

void
consume()
Consumes this event so that it will not be processed in the default manner by the source which originated it.
int
getModifiers()
Returns the modifier mask for this event.
int
getModifiersEx()
Returns the extended modifier mask for this event.
static String
getModifiersExText(int modifiers)
Returns a String describing the extended modifier keys and mouse buttons, such as "Shift", "Button1", or "Ctrl+Shift".
long
getWhen()
Returns the timestamp of when this event occurred.
boolean
isAltDown()
Returns whether or not the Alt modifier is down on this event.
boolean
isAltGraphDown()
Returns whether or not the AltGraph modifier is down on this event.
boolean
isConsumed()
Returns whether or not this event has been consumed.
boolean
isControlDown()
Returns whether or not the Control modifier is down on this event.
boolean
isMetaDown()
Returns whether or not the Meta modifier is down on this event.
boolean
isShiftDown()
Returns whether or not the Shift modifier is down on this event.

Methods inherited from class java.awt.event.ComponentEvent

getComponent, paramString

Methods inherited from class java.awt.AWTEvent

consume, getID, isConsumed, paramString, setSource, toString

Methods inherited from class java.util.EventObject

getSource, toString

Methods inherited from class java.lang.Object

clone, equals, extends Object> getClass, finalize, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Details

ALT_DOWN_MASK

public static final int ALT_DOWN_MASK
The Alt key extended modifier constant.
Field Value:
512
Since:
1.4
Usages and Demos :

View More Examples of InputEvent.ALT_DOWN_MASK
   1: 
   2: import static java.awt.event.InputEvent.ALT_DOWN_MASK;
   3: import static java.awt.event.InputEvent.CTRL_DOWN_MASK;
   4: import static java.awt.event.KeyEvent.VK_TAB;

View Full Code Here
   1:             if ((swtEvent.stateMask & SWT.ALT) != 0) {
   2:                 modifiers = modifiers | InputEvent.ALT_DOWN_MASK;    
   3:             }
   4:             if ((swtEvent.stateMask & SWT.CONTROL) != 0) {
   5:                 modifiers = modifiers | InputEvent.CTRL_DOWN_MASK;

View Full Code Here
   1:             if ((swtEvent.stateMask & SWT.ALT) != 0) {
   2:                 modifiers = modifiers | InputEvent.ALT_DOWN_MASK;    
   3:             }
   4:             if ((swtEvent.stateMask & SWT.CONTROL) != 0) {
   5:                 modifiers = modifiers | InputEvent.CTRL_DOWN_MASK;

View Full Code Here
   1:     if ((mod & InputEvent.ALT_MASK) != 0)
   2:       mod |= InputEvent.ALT_DOWN_MASK;
   3:     if ((mod & InputEvent.BUTTON1_MASK) != 0)
   4:         ...
   5:       mod |= InputEvent.META_MASK;
   6:     if ((mod & InputEvent.ALT_DOWN_MASK) != 0)
   7:       mod |= InputEvent.ALT_MASK;
   8:     if ((mod & InputEvent.ALT_GRAPH_DOWN_MASK) != 0)
   9:       mod |= InputEvent.ALT_GRAPH_MASK;

View Full Code Here
   1:         } else if (modifier.equals(ALT_MODIFIER)) {
   2:             return InputEvent.ALT_DOWN_MASK;
   3:         } else if (modifier.equals(ALT_GRAPH_MODIFIER)) {
   4:             return InputEvent.ALT_GRAPH_DOWN_MASK;
   5:         } else if (modifier.equals(META_MODIFIER)) {

View Full Code Here

ALT_GRAPH_DOWN_MASK

public static final int ALT_GRAPH_DOWN_MASK
The AltGraph key extended modifier constant.
Field Value:
8192
Since:
1.4
Usages and Demos :

View More Examples of InputEvent.ALT_GRAPH_DOWN_MASK
   1:     if ((mod & InputEvent.ALT_GRAPH_MASK) != 0)
   2:       mod |= InputEvent.ALT_GRAPH_DOWN_MASK;
   3:     return mod & ~OLD_MASK;
   4:         ...
   5:       mod |= InputEvent.ALT_MASK;
   6:     if ((mod & InputEvent.ALT_GRAPH_DOWN_MASK) != 0)
   7:       mod |= InputEvent.ALT_GRAPH_MASK;
   8:     if ((mod & InputEvent.BUTTON1_DOWN_MASK) != 0)
   9:       mod |= InputEvent.BUTTON1_MASK;

View Full Code Here
   1:         } else if (modifier.equals(ALT_GRAPH_MODIFIER)) {
   2:             return InputEvent.ALT_GRAPH_DOWN_MASK;
   3:         } else if (modifier.equals(META_MODIFIER)) {
   4:             return InputEvent.META_DOWN_MASK;
   5:         } else if (modifier.equals(SHIFT_MODIFIER)) {

View Full Code Here

ALT_GRAPH_MASK

public static final int ALT_GRAPH_MASK
The AltGraph key modifier constant.
Field Value:
32
Usages and Demos :

View More Examples of InputEvent.ALT_GRAPH_MASK
   1:       mod |= InputEvent.BUTTON1_DOWN_MASK;
   2:     if ((mod & InputEvent.ALT_GRAPH_MASK) != 0)
   3:       mod |= InputEvent.ALT_GRAPH_DOWN_MASK;
   4:         ...
   5:     if ((mod & InputEvent.ALT_GRAPH_DOWN_MASK) != 0)
   6:       mod |= InputEvent.ALT_GRAPH_MASK;
   7:     if ((mod & InputEvent.BUTTON1_DOWN_MASK) != 0)
   8:       mod |= InputEvent.BUTTON1_MASK;
   9:     return mod & OLD_MASK;

View Full Code Here
   1:                                            InputEvent.ALT_MASK |
   2:                                            InputEvent.ALT_GRAPH_MASK |
   3:                                            InputEvent.META_MASK;
   4: 
   5:     private int andMask;

View Full Code Here
   1:     public boolean isAltGraphDown() {
   2:         return (_modifiers & InputEvent.ALT_GRAPH_MASK) != 0;
   3:     }
   4:         ...
   5:                 & Event.ALT_MASK
   6:                 & InputEvent.ALT_GRAPH_MASK)
   7:             != 0;
   8:     }

View Full Code Here
   1:     modifierTable.put("alt", new Integer(InputEvent.ALT_MASK));
   2:     modifierTable.put("alt_graph", new Integer(InputEvent.ALT_GRAPH_MASK));
   3:     modifierTable.put("button1", new Integer(InputEvent.BUTTON1_MASK));
   4:     modifierTable.put("button2", new Integer(InputEvent.BUTTON2_MASK));
   5:     modifierTable.put("button3", new Integer(InputEvent.BUTTON3_MASK));

View Full Code Here
   1:                     ignoreMods = InputEvent.SHIFT_MASK
   2:                         | InputEvent.ALT_GRAPH_MASK;
   3:                 }
   4:         ...
   5:     
   6:                 if((modifiers & InputEvent.ALT_GRAPH_MASK) == 0
   7:                     && evt.getWhen()
   8:                     - KeyEventWorkaround.lastKeyTime < 750L
   9:                     && (KeyEventWorkaround.modifiers & ~ignoreMods)

View Full Code Here

ALT_MASK

public static final int ALT_MASK
The Alt key modifier constant. It is recommended that ALT_DOWN_MASK be used instead.
Field Value:
8
Usages and Demos :

View More Examples of InputEvent.ALT_MASK
   1:                                    Character.forDigit(i, 10),
   2:                                    InputEvent.ALT_MASK);
   3:          String mapKey = "FOCUS_TAB_"+i;
   4:          final int index = i - 1;
   5:          getInputMap(WHEN_IN_FOCUSED_WINDOW).put(shortcut, mapKey);

View Full Code Here
   1:       projectAction_.putValue(Action.ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_G,
   2:           InputEvent.ALT_MASK + InputEvent.CTRL_MASK));
   3:     }
   4:         ...
   5:       visuAction_.putValue(Action.ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_V,
   6:           InputEvent.ALT_MASK + InputEvent.CTRL_MASK));
   7:     }
   8:         ...
   9:       courbeAction_.putValue(Action.ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_C,
  10:           InputEvent.ALT_MASK + InputEvent.CTRL_MASK));
  11:     }

View Full Code Here
   1:                                            InputEvent.CTRL_MASK |
   2:                                            InputEvent.ALT_MASK |
   3:                                            InputEvent.ALT_GRAPH_MASK |
   4:                                            InputEvent.META_MASK;

View Full Code Here
   1:                 KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT,
   2:                         InputEvent.ALT_MASK));
   3: 
   4:         ...
   5:                 KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT,
   6:                         InputEvent.ALT_MASK));
   7: 
   8:         url = this.getClass().getClassLoader().getResource("images/Refresh24.gif");
   9:         refresh = new EmptyAction("", new ImageIcon(url)) {

View Full Code Here

BUTTON1_DOWN_MASK

public static final int BUTTON1_DOWN_MASK
The Mouse Button1 extended modifier constant.
Field Value:
1024
Since:
1.4
Usages and Demos :

View More Examples of InputEvent.BUTTON1_DOWN_MASK
   1:     public RouteTableGraphMousePlugin(RouteTableUICallback callback) {
   2:         super(InputEvent.BUTTON1_DOWN_MASK);
   3:         this.callback = callback;
   4:     }

View Full Code Here
   1:                 (swtEvent.stateMask & SWT.BUTTON1) != 0) {
   2:                 modifiers = modifiers | InputEvent.BUTTON1_DOWN_MASK;
   3:             }
   4:             if (swtEvent.button == 2 ||
   5:                 (swtEvent.stateMask & SWT.BUTTON2) != 0) {

View Full Code Here
   1:     if ((mod & InputEvent.BUTTON1_MASK) != 0)
   2:       mod |= InputEvent.BUTTON1_DOWN_MASK;
   3:     if ((mod & InputEvent.ALT_GRAPH_MASK) != 0)
   4:         ...
   5:       mod |= InputEvent.ALT_GRAPH_MASK;
   6:     if ((mod & InputEvent.BUTTON1_DOWN_MASK) != 0)
   7:       mod |= InputEvent.BUTTON1_MASK;
   8:     return mod & OLD_MASK;
   9:   }

View Full Code Here
   1:     modifiers &=
   2:       InputEvent.BUTTON1_DOWN_MASK |
   3:       InputEvent.BUTTON2_DOWN_MASK |
   4:         ...
   5:       {
   6:       case InputEvent.BUTTON1_DOWN_MASK:
   7:     return 1;
   8:       case InputEvent.BUTTON2_DOWN_MASK:
   9:     return 2;

View Full Code Here
   1:     int button = 0;
   2:     if((modifiers & InputEvent.BUTTON1_DOWN_MASK) == 
   3:         ...
   4:        InputEvent.BUTTON1_DOWN_MASK) button = 1;
   5:     if((modifiers & InputEvent.BUTTON2_DOWN_MASK) == 
   6:         ...
   7:     int button = 0;
   8:     if((modifiers & InputEvent.BUTTON1_DOWN_MASK) == 
   9:        InputEvent.BUTTON1_DOWN_MASK) button = 1;

View Full Code Here

BUTTON1_MASK

public static final int BUTTON1_MASK
The Mouse Button1 modifier constant. It is recommended that BUTTON1_DOWN_MASK be used instead.
Field Value:
16
Usages and Demos :

View More Examples of InputEvent.BUTTON1_MASK
   1:             int modifiers = mouseEvent.getModifiers();
   2:             if ((modifiers & InputEvent.BUTTON1_MASK) ==
   3:         ...
   4:                 InputEvent.BUTTON1_MASK) {
   5:               System.out.println("Left button pressed.");
   6:             }
   7:             if ((modifiers & InputEvent.BUTTON2_MASK) ==

View Full Code Here
   1:     protected static final int BUTTON_MASK =
   2:         InputEvent.BUTTON1_MASK |
   3:         InputEvent.BUTTON2_MASK |
   4:         InputEvent.BUTTON3_MASK;
   5:     

View Full Code Here
   1:     private MouseFilter _controlFilter = new MouseFilter (
   2:             InputEvent.BUTTON1_MASK,
   3:             InputEvent.CTRL_MASK);
   4: 
   5:     public BasicGraphController () {

View Full Code Here
   1:     private MouseFilter _controlFilter = new MouseFilter (
   2:             InputEvent.BUTTON1_MASK,
   3:             InputEvent.CTRL_MASK);
   4: 
   5:     diva.gui.Application _application;

View Full Code Here
   1:         switch (flag) {
   2:         case InputEvent.BUTTON1_MASK:
   3:             return "BUTTON1_MASK";
   4:         case InputEvent.BUTTON2_MASK:
   5:             return "BUTTON2_MASK";

View Full Code Here

BUTTON2_DOWN_MASK

public static final int BUTTON2_DOWN_MASK
The Mouse Button2 extended modifier constant.
Field Value:
2048
Since:
1.4
Usages and Demos :

View More Examples of InputEvent.BUTTON2_DOWN_MASK
   1:                 (swtEvent.stateMask & SWT.BUTTON2) != 0) {
   2:                 modifiers = modifiers | InputEvent.BUTTON2_DOWN_MASK;
   3:             }
   4:             if (swtEvent.button == 3 ||
   5:                 (swtEvent.stateMask & SWT.BUTTON3) != 0) {

View Full Code Here
   1:       InputEvent.BUTTON1_DOWN_MASK |
   2:       InputEvent.BUTTON2_DOWN_MASK |
   3:       InputEvent.BUTTON3_DOWN_MASK;
   4:         ...
   5:     return 1;
   6:       case InputEvent.BUTTON2_DOWN_MASK:
   7:     return 2;
   8:       case InputEvent.BUTTON3_DOWN_MASK:
   9:     return 3;

View Full Code Here
   1:        InputEvent.BUTTON1_DOWN_MASK) button = 1;
   2:     if((modifiers & InputEvent.BUTTON2_DOWN_MASK) == 
   3:         ...
   4:        InputEvent.BUTTON2_DOWN_MASK) button = 2;
   5:     if((modifiers & InputEvent.BUTTON3_DOWN_MASK) == 
   6:         ...
   7:        InputEvent.BUTTON1_DOWN_MASK) button = 1;
   8:     if((modifiers & InputEvent.BUTTON2_DOWN_MASK) == 
   9:        InputEvent.BUTTON2_DOWN_MASK) button = 2;

View Full Code Here
   1:   {
   2:     return ((event.getModifiersEx() & InputEvent.BUTTON2_DOWN_MASK)
   3:         ...
   4:          == InputEvent.BUTTON2_DOWN_MASK);
   5:   }
   6: 
   7:   public static boolean isRightMouseButton(MouseEvent event)

View Full Code Here

BUTTON2_MASK

public static final int BUTTON2_MASK
The Mouse Button2 modifier constant. It is recommended that BUTTON2_DOWN_MASK be used instead. Note that BUTTON2_MASK has the same value as ALT_MASK.
Field Value:
8
Usages and Demos :

View More Examples of InputEvent.BUTTON2_MASK
   1:             }
   2:             if ((modifiers & InputEvent.BUTTON2_MASK) ==
   3:         ...
   4:                 InputEvent.BUTTON2_MASK) {
   5:               System.out.println("Middle button pressed.");
   6:             }
   7:             if ((modifiers & InputEvent.BUTTON3_MASK) ==

View Full Code Here
   1:         InputEvent.BUTTON1_MASK |
   2:         InputEvent.BUTTON2_MASK |
   3:         InputEvent.BUTTON3_MASK;
   4:     
   5:     

View Full Code Here
   1:                 (swtEvent.stateMask & SWT.BUTTON2) != 0) {
   2:                 modifiers = modifiers | InputEvent.BUTTON2_MASK;
   3:             }
   4:             if (swtEvent.button == 3 ||
   5:                 (swtEvent.stateMask & SWT.BUTTON3) != 0) {

View Full Code Here
   1:       case 2:
   2:     modifiers = InputEvent.BUTTON2_MASK;
   3:     break;
   4:         ...
   5:       case 3:
   6:     modifiers = InputEvent.BUTTON2_MASK;
   7:     break;
   8:       }
   9:     

View Full Code Here
   1:             return "BUTTON1_MASK";
   2:         case InputEvent.BUTTON2_MASK:
   3:             return "BUTTON2_MASK";
   4:         case InputEvent.BUTTON3_MASK:
   5:             return "BUTTON3_MASK";

View Full Code Here

BUTTON3_DOWN_MASK

public static final int BUTTON3_DOWN_MASK
The Mouse Button3 extended modifier constant.
Field Value:
4096
Since:
1.4
Usages and Demos :

View More Examples of InputEvent.BUTTON3_DOWN_MASK
   1:                 (swtEvent.stateMask & SWT.BUTTON3) != 0) {
   2:                 modifiers = modifiers | InputEvent.BUTTON3_DOWN_MASK;
   3:             }
   4:         }
   5:         

View Full Code Here
   1:       InputEvent.BUTTON2_DOWN_MASK |
   2:       InputEvent.BUTTON3_DOWN_MASK;
   3:     
   4:         ...
   5:     return 2;
   6:       case InputEvent.BUTTON3_DOWN_MASK:
   7:     return 3;
   8:       case 0:
   9:     return 0;

View Full Code Here
   1:     if (!(panel instanceof TrackerPanel)) return;
   2:     int mask = InputEvent.BUTTON3_DOWN_MASK;
   3:     if (e.isPopupTrigger() || (e.getModifiersEx() & mask) == mask ||
   4:        (e.isControlDown() && Tracker.isMacOS))
   5:       return;

View Full Code Here
   1:       public void mousePressed(MouseEvent e) {
   2:         int mask = InputEvent.BUTTON3_DOWN_MASK;
   3:         if (e.isPopupTrigger() || (e.getModifiersEx() & mask) == mask ||
   4:            (e.isControlDown() && Tracker.isMacOS)) {
   5:           popup.show(WorldTView.this, e.getX(), e.getY());

View Full Code Here
   1:       public void mouseReleased(MouseEvent e) {
   2:         int mask = InputEvent.BUTTON3_DOWN_MASK;
   3:         if (e.isPopupTrigger() || (e.getModifiersEx() & mask) == mask ||
   4:            (e.isControlDown() && Tracker.isMacOS)) {
   5:           JPopupMenu popup = trackerPanel.popup;

View Full Code Here

BUTTON3_MASK

public static final int BUTTON3_MASK
The Mouse Button3 modifier constant. It is recommended that BUTTON3_DOWN_MASK be used instead. Note that BUTTON3_MASK has the same value as META_MASK.
Field Value:
4
Usages and Demos :

View More Examples of InputEvent.BUTTON3_MASK
   1:         if (((event.getModifiers() &
   2:             InputEvent.BUTTON3_MASK)
   3:             != 0) &&
   4:             (tree.getSelectionCount() > 0)) {
   5:           showMenu(event.getX(), event.getY());

View Full Code Here
   1:     MouseFilter filter = new MouseFilter (
   2:             InputEvent.BUTTON3_MASK);
   3:     setMouseFilter(filter);
   4:     setMenuFactory(factory);
   5:     }

View Full Code Here
   1:             }
   2:             if ((modifiers & InputEvent.BUTTON3_MASK) ==
   3:         ...
   4:                 InputEvent.BUTTON3_MASK) {
   5:               System.out.println("Right button pressed.");
   6:             }
   7:           }

View Full Code Here
   1:         InputEvent.BUTTON2_MASK |
   2:         InputEvent.BUTTON3_MASK;
   3:     
   4:     
   5:     public MouseCaptureEvent( int type, MouseEvent event )

View Full Code Here
   1:             return "BUTTON2_MASK";
   2:         case InputEvent.BUTTON3_MASK:
   3:             return "BUTTON3_MASK";
   4:             
   5:         case InputEvent.CTRL_MASK:

View Full Code Here

CTRL_DOWN_MASK

public static final int CTRL_DOWN_MASK
The Control key extended modifier constant.
Field Value:
128
Since:
1.4
Usages and Demos :

View More Examples of InputEvent.CTRL_DOWN_MASK
   1: import static java.awt.event.InputEvent.ALT_DOWN_MASK;
   2: import static java.awt.event.InputEvent.CTRL_DOWN_MASK;
   3: import static java.awt.event.KeyEvent.VK_TAB;
   4: 
   5: import java.awt.event.ActionEvent;

View Full Code Here
   1:             'x',
   2:             KeyStroke.getKeyStroke('Q', InputEvent.CTRL_DOWN_MASK),
   3:             "Exit from this application");
   4:     }

View Full Code Here
   1:             if ((swtEvent.stateMask & SWT.CONTROL) != 0) {
   2:                 modifiers = modifiers | InputEvent.CTRL_DOWN_MASK;
   3:             }
   4:             if ((swtEvent.stateMask & SWT.SHIFT) != 0) {
   5:                 modifiers = modifiers | InputEvent.SHIFT_DOWN_MASK;    

View Full Code Here
   1:             'L',
   2:             KeyStroke.getKeyStroke('L', InputEvent.CTRL_DOWN_MASK),
   3:             "Changes the Look and Feel");
   4:         this.frame = frame;
   5:         themes = new String[] { "win2k.tp.zip", "winxp.tp.zip", "acqua.tp.zip" };

View Full Code Here
   1:             'c',
   2:             KeyStroke.getKeyStroke('C', InputEvent.CTRL_DOWN_MASK),
   3:             null);
   4:         this.admin = admin;
   5:     }

View Full Code Here

CTRL_MASK

public static final int CTRL_MASK
The Control key modifier constant. It is recommended that CTRL_DOWN_MASK be used instead.
Field Value:
2
Usages and Demos :

View More Examples of InputEvent.CTRL_MASK
   1:             InputEvent.BUTTON1_MASK,
   2:             InputEvent.CTRL_MASK);
   3: 
   4:     public BasicGraphController () {
   5:     NodeController nc = new BasicNodeController(this);

View Full Code Here
   1:     new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_INSERT, 
   2:                                     InputEvent.CTRL_MASK),
   3:                          DefaultEditorKit.copyAction),
   4:     new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_INSERT, 
   5:                                     InputEvent.SHIFT_MASK),

View Full Code Here
   1:          (KeyStroke.getKeyStroke(KeyEvent.VK_O,
   2:          InputEvent.CTRL_MASK));
   3:       opcionGuardar = new JMenuItem("Guardar");
   4:         ...
   5:          (KeyStroke.getKeyStroke(KeyEvent.VK_S,
   6:          InputEvent.CTRL_MASK));
   7:       opcionGuardarComo = new JMenuItem("Guardar como...");
   8: 
   9:       barraMenus.add(hacerMenu(menuArchivo,

View Full Code Here
   1:     KeyStroke next = KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT,
   2:       InputEvent.CTRL_MASK, false);
   3:     KeyStroke prev = KeyStroke.getKeyStroke(KeyEvent.VK_LEFT,
   4:         ...
   5:       InputEvent.CTRL_MASK, false);
   6:     KeyStroke selNext = KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT,
   7:         ...
   8:       InputEvent.CTRL_MASK|InputEvent.SHIFT_MASK, false);
   9:     KeyStroke selPrev = KeyStroke.getKeyStroke(KeyEvent.VK_LEFT,

View Full Code Here
   1:             InputEvent.BUTTON1_MASK,
   2:             InputEvent.CTRL_MASK);
   3: 
   4:     diva.gui.Application _application;

View Full Code Here

META_DOWN_MASK

public static final int META_DOWN_MASK
The Meta key extended modifier constant.
Field Value:
256
Since:
1.4
Usages and Demos :

View More Examples of InputEvent.META_DOWN_MASK
   1:     if ((mod & InputEvent.META_MASK) != 0)
   2:       mod |= InputEvent.META_DOWN_MASK;
   3:     if ((mod & InputEvent.ALT_MASK) != 0)
   4:         ...
   5:       mod |= InputEvent.CTRL_MASK;
   6:     if ((mod & InputEvent.META_DOWN_MASK) != 0)
   7:       mod |= InputEvent.META_MASK;
   8:     if ((mod & InputEvent.ALT_DOWN_MASK) != 0)
   9:       mod |= InputEvent.ALT_MASK;

View Full Code Here
   1:                                            InputEvent.CTRL_DOWN_MASK |
   2:                                            InputEvent.META_DOWN_MASK;
   3: 
   4:   public static final MouseButtonListener MIDDLE_BUTTON_CLOSE_LISTENER =
   5:       new DockingWindowActionMouseButtonListener(MouseEvent.BUTTON2, CloseWithAbortWindowAction.INSTANCE);

View Full Code Here
   1:         } else if (modifier.equals(META_MODIFIER)) {
   2:             return InputEvent.META_DOWN_MASK;
   3:         } else if (modifier.equals(SHIFT_MODIFIER)) {
   4:             return InputEvent.SHIFT_DOWN_MASK;
   5:         } else {

View Full Code Here

META_MASK

public static final int META_MASK
The Meta key modifier constant. It is recommended that META_DOWN_MASK be used instead.
Field Value:
4
Usages and Demos :

View More Examples of InputEvent.META_MASK
   1:                                            InputEvent.ALT_GRAPH_MASK |
   2:                                            InputEvent.META_MASK;
   3: 
   4:     private int andMask;
   5:     private int orMask;

View Full Code Here
   1:     modifierTable.put("control", new Integer(InputEvent.CTRL_MASK));
   2:     modifierTable.put("meta", new Integer(InputEvent.META_MASK));
   3:     modifierTable.put("alt", new Integer(InputEvent.ALT_MASK));
   4:     modifierTable.put("alt_graph", new Integer(InputEvent.ALT_GRAPH_MASK));
   5:     modifierTable.put("button1", new Integer(InputEvent.BUTTON1_MASK));

View Full Code Here
   1:     InputEvent.CTRL_MASK,
   2:     InputEvent.META_MASK,
   3:     };
   4: 
   5:     private static String[] maskStrings = {

View Full Code Here
   1:         }
   2:         if((duplicateMapping & InputEvent.META_MASK) != 0) {
   3:             throw new IllegalArgumentException(
   4:         ...
   5:         InputEvent.ALT_MASK,
   6:         InputEvent.META_MASK,
   7:         InputEvent.SHIFT_MASK
   8:         ...
   9:         if(evt.isMetaDown())
  10:             buf.append(getSymbolicModifierName(InputEvent.META_MASK));
  11:         if(evt.isShiftDown())

View Full Code Here

SHIFT_DOWN_MASK

public static final int SHIFT_DOWN_MASK
The Shift key extended modifier constant.
Field Value:
64
Since:
1.4
Usages and Demos :

View More Examples of InputEvent.SHIFT_DOWN_MASK
   1:             if ((swtEvent.stateMask & SWT.SHIFT) != 0) {
   2:                 modifiers = modifiers | InputEvent.SHIFT_DOWN_MASK;    
   3:             }
   4:         }
   5:         

View Full Code Here
   1:             if ((swtEvent.stateMask & SWT.SHIFT) != 0) {
   2:                 modifiers = modifiers | InputEvent.SHIFT_DOWN_MASK;    
   3:             }
   4:             if (swtEvent.button == 1 ||
   5:                 (swtEvent.stateMask & SWT.BUTTON1) != 0) {

View Full Code Here
   1:     if ((mod & InputEvent.SHIFT_MASK) != 0)
   2:       mod |= InputEvent.SHIFT_DOWN_MASK;
   3:     if ((mod & InputEvent.CTRL_MASK) != 0)
   4:         ...
   5:   {
   6:     if ((mod & InputEvent.SHIFT_DOWN_MASK) != 0)
   7:       mod |= InputEvent.SHIFT_MASK;
   8:     if ((mod & InputEvent.CTRL_DOWN_MASK) != 0)
   9:       mod |= InputEvent.CTRL_MASK;

View Full Code Here
   1:   private static final int MODIFIER_MASK = InputEvent.ALT_DOWN_MASK |
   2:                                            InputEvent.SHIFT_DOWN_MASK |
   3:                                            InputEvent.CTRL_DOWN_MASK |
   4:                                            InputEvent.META_DOWN_MASK;

View Full Code Here
   1:         } else if (modifier.equals(SHIFT_MODIFIER)) {
   2:             return InputEvent.SHIFT_DOWN_MASK;
   3:         } else {
   4:             LOG.debug("Unknown modifier: " + modifier);
   5:             return 0;

View Full Code Here

SHIFT_MASK

public static final int SHIFT_MASK
The Shift key modifier constant. It is recommended that SHIFT_DOWN_MASK be used instead.
Field Value:
1
Usages and Demos :

View More Examples of InputEvent.SHIFT_MASK
   1:             KeyStroke.getKeyStroke(KeyEvent.VK_TAB,
   2:             InputEvent.SHIFT_MASK));
   3:         setFocusTraversalKeys(
   4:             KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS,
   5:             focusForwardTraversalKeys);

View Full Code Here
   1:     new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_INSERT, 
   2:                                     InputEvent.SHIFT_MASK),
   3:                          DefaultEditorKit.pasteAction),
   4:         ...
   5:     new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_LEFT, 
   6:                                     InputEvent.SHIFT_MASK),
   7:                          DefaultEditorKit.selectionBackwardAction),
   8:         ...
   9:     new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT, 
  10:                                     InputEvent.SHIFT_MASK),
  11:                          DefaultEditorKit.selectionForwardAction),

View Full Code Here
   1:     KeyStroke selNext = KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT,
   2:       InputEvent.CTRL_MASK|InputEvent.SHIFT_MASK, false);
   3:     KeyStroke selPrev = KeyStroke.getKeyStroke(KeyEvent.VK_LEFT,
   4:         ...
   5:       InputEvent.CTRL_MASK|InputEvent.SHIFT_MASK, false);
   6: 
   7:     map.addActionForKeyStroke(next, getHashedAction(
   8:       DefaultEditorKit.nextWordAction));

View Full Code Here
   1:             return "CTRL_MASK";
   2:         case InputEvent.SHIFT_MASK:
   3:             return "SHIFT_MASK";
   4:             
   5:         }

View Full Code Here
   1:                                            InputEvent.BUTTON3_MASK |
   2:                                            InputEvent.SHIFT_MASK |
   3:                                            InputEvent.CTRL_MASK |
   4:                                            InputEvent.ALT_MASK |
   5:                                            InputEvent.ALT_GRAPH_MASK |

View Full Code Here

Method Details

consume

public void consume()
Consumes this event so that it will not be processed in the default manner by the source which originated it.
Overrides:
consume in interface AWTEvent
Usages and Demos :

View More Examples of consume()
   1: import java.awt.Rectangle;
   2: import java.awt.event.InputEvent;
   3: import java.awt.event.MouseEvent;
   4:         ...
   5: 
   6:     protected void createContainedModelElement(FigGroup fg, InputEvent ie) {
   7:         if (!(fg instanceof FigFeaturesCompartment)) {
   8:         ...
   9:         }
  10:         ie.consume();
  11:     }

View Full Code Here
   1:             
   2:             if ((modifiers&InputEvent.CTRL_MASK)!=0) {
   3:                 if (keyChar<0x20) {
   4:         ...
   5:                     {
   6:                         evt.consume();
   7:                         returnValue = new Key(
   8:         ...
   9:                     {
  10:                         if((modifiers & ~InputEvent.SHIFT_MASK) == 0)
  11:                             returnValue = null;
  12:         ...
  13:                 case ' ':
  14:                     if((modifiers & ~InputEvent.SHIFT_MASK) != 0)

View Full Code Here
   1: import java.awt.Rectangle;
   2: import java.awt.event.InputEvent;
   3: import java.awt.event.MouseEvent;
   4:         ...
   5:            && !(me.isPopupTrigger()
   6:             || me.getModifiers() == InputEvent.BUTTON3_MASK)) {
   7:         createContainedModelElement(epVec, me);
   8:         ...
   9: 
  10:     protected void createContainedModelElement(FigGroup fg, InputEvent ie) {
  11: 
  12:         ...
  13:         }
  14:         ie.consume();

View Full Code Here

getModifiers

public int getModifiers()
Returns the modifier mask for this event.
Usages and Demos :

View More Examples of getModifiers()
   1: 
   2: import java.awt.event.InputEvent;
   3: 
   4:         ...
   5: 
   6:     public static final int SHIFT_MASK = InputEvent.SHIFT_MASK;
   7: 
   8:         ...
   9:     public static final int CTRL_MASK = InputEvent.CTRL_MASK;
  10: 
  11:         ...
  12:         this.when = evt.getWhen();
  13:         this.modifiers = evt.getModifiers();

View Full Code Here
   1: import java.awt.Font;
   2: import java.awt.event.InputEvent;
   3: 
   4:         ...
   5:     
   6:     public static boolean isButtonPressed(InputEvent e, int button) {
   7:         ...
   8:         return (e.getModifiers() & button) == button;
   9:     }

View Full Code Here
   1: import java.awt.Cursor;
   2: import java.awt.event.InputEvent;
   3: import java.awt.event.KeyEvent;
   4:         ...
   5: 
   6:     private InputEvent inputEvent;
   7:     private PPickPath pickPath;
   8:     private PInputManager inputManager;
   9:     private boolean handled;

View Full Code Here
   1:             int    keyCode        = evt.getKeyCode();
   2:             int    modifiers    = evt.getModifiers();
   3:             boolean usecooked    = !evt.isActionKey();
   4:         ...
   5:             
   6:             if ((modifiers&InputEvent.CTRL_MASK)!=0) {
   7:                 if (keyChar<0x20) {
   8:         ...
   9:         {
  10:             int modifiers = evt.getModifiers();
  11:             Key returnValue;
  12:         ...
  13:                     {
  14:                         if((modifiers & ~InputEvent.SHIFT_MASK) == 0)

View Full Code Here
   1: import java.awt.Point;
   2: import java.awt.event.InputEvent;
   3: import java.awt.event.KeyEvent;
   4:         ...
   5:     private int nodeDecrementEventCode = KeyEvent.VK_TAB;
   6:     private int nodeDecrementEventModifiers = InputEvent.SHIFT_MASK;
   7: 
   8:         ...
   9:         } else if (evt instanceof KeyEvent) {
  10:             InputEvent e = (InputEvent)evt;
  11:             if (isNodeIncrementEvent(e)) {
  12:         ...
  13:                                           evt.getWhen(),
  14:                                           evt.getModifiers(),

View Full Code Here

getModifiersEx

public int getModifiersEx()
Returns the extended modifier mask for this event. Extended modifiers represent the state of all modal keys, such as ALT, CTRL, META, and the mouse buttons just after the event occurred

For example, if the user presses button 1 followed by button 2, and then releases them in the same order, the following sequence of events is generated:

    MOUSE_PRESSED:  BUTTON1_DOWN_MASK
    MOUSE_PRESSED:  BUTTON1_DOWN_MASK | BUTTON2_DOWN_MASK
    MOUSE_RELEASED: BUTTON2_DOWN_MASK
    MOUSE_CLICKED:  BUTTON2_DOWN_MASK
    MOUSE_RELEASED: 
    MOUSE_CLICKED:  
 

It is not recommended to compare the return value of this method using == because new modifiers can be added in the future. For example, the appropriate way to check that SHIFT and BUTTON1 are down, but CTRL is up is demonstrated by the following code:

    int onmask = SHIFT_DOWN_MASK | BUTTON1_DOWN_MASK;
    int offmask = CTRL_DOWN_MASK;
    if (event.getModifiersEx() & (onmask | offmask) == onmask) {
        ...
    }
 
The above code will work even if new modifiers are added.
Since:
1.4
Usages and Demos :

View More Examples of getModifiersEx()
   1: import java.awt.event.ActionListener;
   2: import java.awt.event.InputEvent;
   3: import java.awt.event.KeyAdapter;
   4:         ...
   5:             {
   6:                 int ex = e.getModifiersEx();
   7:                 int code = e.getKeyCode();
   8:         ...
   9:                 System.out.println();
  10:                 System.out.println("RELEASED key = " + e.getKeyCode() + " modifiers: " + e.getModifiersEx());
  11:             }
  12:         ...
  13:             {
  14:                 System.out.println("e.getModifiersEx() = " + e.getModifiersEx());

View Full Code Here
   1: import jp.ujihara.java.awt.event.HierarchyListener;
   2: import jp.ujihara.java.awt.event.InputEvent;
   3: import jp.ujihara.java.awt.event.InputMethodEvent;
   4:         ...
   5: 
   6:     if (e instanceof InputEvent)
   7:       {
   8:         ...
   9:         InputEvent ie = (InputEvent) e;
  10:         long when = ie.getWhen ();
  11:         ...
  12:         int oldMods = 0;
  13:         int mods = ie.getModifiersEx();

View Full Code Here

getModifiersExText

public static String getModifiersExText(int modifiers)
Returns a String describing the extended modifier keys and mouse buttons, such as "Shift", "Button1", or "Ctrl+Shift". These strings can be localized by changing the awt.properties file.
Parameters:
modifiers - a modifier mask describing the extended modifier keys and mouse buttons for the event
Returns:
a text description of the combination of extended modifier keys and mouse buttons that were held down during the event.
Since:
1.4

getWhen

public long getWhen()
Returns the timestamp of when this event occurred.
Usages and Demos :

View More Examples of getWhen()
   1: import java.awt.Robot;
   2: import java.awt.event.InputEvent;
   3: 
   4:         ...
   5:     
   6:     private InputEvent event = null;
   7:     
   8:         ...
   9:     
  10:     public CaptureEvent( int eventType, InputEvent event )
  11:     {
  12:         ...
  13:         {
  14:             this.timeOfEvent = event.getWhen();

View Full Code Here
   1: 
   2: import java.awt.event.InputEvent;
   3: 
   4:         ...
   5: 
   6:     public static final int SHIFT_MASK = InputEvent.SHIFT_MASK;
   7: 
   8:         ...
   9:     public static final int CTRL_MASK = InputEvent.CTRL_MASK;
  10: 
  11:         ...
  12:         super(source, evt.getID());
  13:         this.when = evt.getWhen();

View Full Code Here
   1: import java.awt.Button;
   2: import java.awt.event.InputEvent;
   3: import java.awt.event.KeyEvent;
   4:         ...
   5:     {
   6:         InputEvent ie = null;
   7:         CaptureEvent ce = createCaptureEvent( ie );
   8:         ...
   9:     {
  10:         InputEvent ie = createInputEvent();
  11:         CaptureEvent ce = createCaptureEvent( ie );
  12:         ...
  13:             ce.getTimeOfEvent(),
  14:             ie.getWhen() );

View Full Code Here
   1: import java.awt.Cursor;
   2: import java.awt.event.InputEvent;
   3: import java.awt.event.KeyEvent;
   4:         ...
   5: 
   6:     private InputEvent inputEvent;
   7:     private PPickPath pickPath;
   8:     private PInputManager inputManager;
   9:     private boolean handled;

View Full Code Here
   1: import jp.ujihara.java.awt.event.HierarchyListener;
   2: import jp.ujihara.java.awt.event.InputEvent;
   3: import jp.ujihara.java.awt.event.InputMethodEvent;
   4:         ...
   5: 
   6:     if (e instanceof InputEvent)
   7:       {
   8:         ...
   9:         InputEvent ie = (InputEvent) e;
  10:         ...
  11:         long when = ie.getWhen();

View Full Code Here

isAltDown

public boolean isAltDown()
Returns whether or not the Alt modifier is down on this event.
Usages and Demos :

View More Examples of isAltDown()
   1: import java.awt.Cursor;
   2: import java.awt.event.InputEvent;
   3: import java.awt.event.KeyEvent;
   4:         ...
   5: 
   6:     private InputEvent inputEvent;
   7:     private PPickPath pickPath;
   8:     private PInputManager inputManager;
   9:     private boolean handled;

View Full Code Here

isAltGraphDown

public boolean isAltGraphDown()
Returns whether or not the AltGraph modifier is down on this event.

isConsumed

public boolean isConsumed()
Returns whether or not this event has been consumed.
Overrides:
isConsumed in interface AWTEvent
See Also:
consume()

isControlDown

public boolean isControlDown()
Returns whether or not the Control modifier is down on this event.
Usages and Demos :

View More Examples of isControlDown()
   1: import java.awt.Cursor;
   2: import java.awt.event.InputEvent;
   3: import java.awt.event.KeyEvent;
   4:         ...
   5: 
   6:     private InputEvent inputEvent;
   7:     private PPickPath pickPath;
   8:     private PInputManager inputManager;
   9:     private boolean handled;

View Full Code Here

isMetaDown

public boolean isMetaDown()
Returns whether or not the Meta modifier is down on this event.

isShiftDown

public boolean isShiftDown()
Returns whether or not the Shift modifier is down on this event.
Usages and Demos :

View More Examples of isShiftDown()
   1: import java.awt.Cursor;
   2: import java.awt.event.InputEvent;
   3: import java.awt.event.KeyEvent;
   4:         ...
   5: 
   6:     private InputEvent inputEvent;
   7:     private PPickPath pickPath;
   8:     private PInputManager inputManager;
   9:     private boolean handled;

View Full Code Here