| 1 | /* Copyright (C) 1999, 2000, 2002 Free Software Foundation
|
|---|
| 2 |
|
|---|
| 3 | This file is part of libjava.
|
|---|
| 4 |
|
|---|
| 5 | This software is copyrighted work licensed under the terms of the
|
|---|
| 6 | Libjava License. Please consult the file "LIBJAVA_LICENSE" for
|
|---|
| 7 | details. */
|
|---|
| 8 |
|
|---|
| 9 | package java.awt.event;
|
|---|
| 10 | import java.awt.*;
|
|---|
| 11 |
|
|---|
| 12 | /* Status: Believed complete and correct to JDK 1.2. */
|
|---|
| 13 |
|
|---|
| 14 | public abstract class InputEvent extends ComponentEvent
|
|---|
| 15 | {
|
|---|
| 16 | public static final int ALT_GRAPH_MASK = 32;
|
|---|
| 17 | public static final int ALT_MASK = 8;
|
|---|
| 18 | public static final int BUTTON1_MASK = 16;
|
|---|
| 19 | public static final int BUTTON2_MASK = 8;
|
|---|
| 20 | public static final int BUTTON3_MASK = 4;
|
|---|
| 21 | public static final int CTRL_MASK = 2;
|
|---|
| 22 | public static final int META_MASK = 4;
|
|---|
| 23 | public static final int SHIFT_MASK = 1;
|
|---|
| 24 |
|
|---|
| 25 | InputEvent (Component source, int id) // Not public
|
|---|
| 26 | {
|
|---|
| 27 | super(source, id);
|
|---|
| 28 | }
|
|---|
| 29 |
|
|---|
| 30 | public boolean isShiftDown ()
|
|---|
| 31 | {
|
|---|
| 32 | return (modifiers & SHIFT_MASK) != 0;
|
|---|
| 33 | }
|
|---|
| 34 |
|
|---|
| 35 | public boolean isControlDown ()
|
|---|
| 36 | {
|
|---|
| 37 | return (modifiers & CTRL_MASK) != 0;
|
|---|
| 38 | }
|
|---|
| 39 |
|
|---|
| 40 | public boolean isMetaDown ()
|
|---|
| 41 | {
|
|---|
| 42 | return (modifiers & META_MASK) != 0;
|
|---|
| 43 | }
|
|---|
| 44 |
|
|---|
| 45 | public boolean isAltDown ()
|
|---|
| 46 | {
|
|---|
| 47 | return (modifiers & ALT_MASK) != 0;
|
|---|
| 48 | }
|
|---|
| 49 |
|
|---|
| 50 | public boolean isAltGraphDown ()
|
|---|
| 51 | {
|
|---|
| 52 | return (modifiers & ALT_GRAPH_MASK) != 0;
|
|---|
| 53 | }
|
|---|
| 54 |
|
|---|
| 55 | public long getWhen ()
|
|---|
| 56 | {
|
|---|
| 57 | return when;
|
|---|
| 58 | }
|
|---|
| 59 |
|
|---|
| 60 | public int getModifiers ()
|
|---|
| 61 | {
|
|---|
| 62 | return modifiers;
|
|---|
| 63 | }
|
|---|
| 64 |
|
|---|
| 65 | public boolean isConsumed ()
|
|---|
| 66 | {
|
|---|
| 67 | return consumed;
|
|---|
| 68 | }
|
|---|
| 69 |
|
|---|
| 70 | public void consume ()
|
|---|
| 71 | {
|
|---|
| 72 | /* FIXME */
|
|---|
| 73 | consumed = true;
|
|---|
| 74 | }
|
|---|
| 75 |
|
|---|
| 76 | long when;
|
|---|
| 77 | int modifiers;
|
|---|
| 78 | }
|
|---|