public class ModifierTracker extends Object
For example, if you need the cursor to change when the alt key is pressed: just add a listener to this class and you will be notified when appropriate.
| Constructor and Description |
|---|
ModifierTracker()
|
| Modifier and Type | Method and Description |
|---|---|
static void |
addAltChangeListener(ChangeListener
|
static void |
addAltGraphChangeListener(ChangeListener
|
static void |
addControlChangeListener(ChangeListener
|
static void |
addMetaChangeListener(ChangeListener
|
static void |
addShiftChangeListener(ChangeListener
|
static int |
getModifiers()
|
static boolean |
isActive()
|
static boolean |
isAltDown()
|
static boolean |
isAltGraphyDown()
|
static boolean |
isControlDown()
|
static boolean |
isMetaDown()
|
static boolean |
isShiftDown()
|
static void |
removeAltChangeListener(ChangeListener
|
static void |
removeAltGraphChangeListener(ChangeListener
|
static void |
removeControlChangeListener(ChangeListener
|
static void |
removeMetaChangeListener(ChangeListener
|
static void |
removeShiftChangeListener(ChangeListener
|
static void |
track(JApplet
Add KeyListeners to everything in an applet.
|
public static void track(JAppletapplet)
Unsigned applets can't simply add an event listener to the toolkit for security reasons, so this method provides an alternative approach.
This alternative should work in controlled environments where components are not added to an applet after this method is called, but in other cases it might fail.
applet - the applet to track
public static boolean isActive()
public static int getModifiers()
public static void addAltChangeListener(ChangeListenerl)
public static void addAltGraphChangeListener(ChangeListenerl)
public static void addMetaChangeListener(ChangeListenerl)
public static void addShiftChangeListener(ChangeListenerl)
public static void addControlChangeListener(ChangeListenerl)
public static boolean isAltDown()
public static boolean isAltGraphyDown()
public static boolean isShiftDown()
public static boolean isMetaDown()
public static boolean isControlDown()
public static void removeAltChangeListener(ChangeListenerl)
public static void removeAltGraphChangeListener(ChangeListenerl)
public static void removeMetaChangeListener(ChangeListenerl)
public static void removeShiftChangeListener(ChangeListenerl)
public static void removeControlChangeListener(ChangeListenerl)