Class KeyEvent
All Packages Class Hierarchy This Package Previous Next Index
Class KeyEvent
public class netscape.application.KeyEvent
extends netscape.application.Event
{
/* Fields
*/
public final static int ALT_MASK;
public final static int BACKSPACE_KEY;
public final static int CONTROL_MASK;
public final static int DELETE_KEY;
public final static int DOWN_ARROW_KEY;
public final static int END_KEY;
public final static int ESCAPE_KEY;
public final static int F10_KEY;
public final static int F11_KEY;
public final static int F12_KEY;
public final static int F1_KEY;
public final static int F2_KEY;
public final static int F3_KEY;
public final static int F4_KEY;
public final static int F5_KEY;
public final static int F6_KEY;
public final static int F7_KEY;
public final static int F8_KEY;
public final static int F9_KEY;
public final static int HOME_KEY;
public final static int KEY_DOWN;
public final static int KEY_UP;
public final static int LEFT_ARROW_KEY;
public final static int META_MASK;
public final static int NO_MODIFIERS_MASK;
public final static int PAGE_DOWN_KEY;
public final static int PAGE_UP_KEY;
public final static int RETURN_KEY;
public final static int RIGHT_ARROW_KEY;
public final static int SHIFT_MASK;
public final static int TAB_KEY;
public final static int UP_ARROW_KEY;
public int key;
public int modifiers;
/* Constructors
*/
public KeyEvent();
public KeyEvent(long, int, int, boolean);
/* Methods
*/
public boolean isAltKeyDown();
public boolean isArrowKey();
public boolean isBackTabKey();
public boolean isBackspaceKey();
public boolean isControlKeyDown();
public boolean isDeleteKey();
public boolean isDownArrowKey();
public boolean isEndKey();
public boolean isEscapeKey();
public boolean isExtendedKeyEvent();
public int isFunctionKey();
public boolean isHomeKey();
public boolean isLeftArrowKey();
public boolean isMetaKeyDown();
public boolean isPageDownKey();
public boolean isPageUpKey();
public boolean isPrintableKey();
public boolean isReturnKey();
public boolean isRightArrowKey();
public boolean isShiftKeyDown();
public boolean isTabKey();
public boolean isUpArrowKey();
public char keyChar();
public int keyCode();
public RootView rootView();
public void setRootView(RootView);
public String toString();
}
Event subclass used for all key up and key down events.
Fields
key
public int key
- The key that was pressed or released.
modifiers
public int modifiers
- The modifier keys that the user held down when the KeyEvent was
generated.
KEY_DOWN
public final static int KEY_DOWN
- Key "down" event.
KEY_UP
public final static int KEY_UP
- Key "up" event.
NO_MODIFIERS_MASK
public final static int NO_MODIFIERS_MASK
- No modifiers
ALT_MASK
public final static int ALT_MASK
- The Alternate key modifier bitmask.
CONTROL_MASK
public final static int CONTROL_MASK
- The Control key modifier bitmask.
SHIFT_MASK
public final static int SHIFT_MASK
- The Shift key modifier bitmask.
META_MASK
public final static int META_MASK
- The Meta key modifier bitmask.
RETURN_KEY
public final static int RETURN_KEY
- Return key
BACKSPACE_KEY
public final static int BACKSPACE_KEY
- Backspace key
DELETE_KEY
public final static int DELETE_KEY
- Delete key
ESCAPE_KEY
public final static int ESCAPE_KEY
- Escape key
TAB_KEY
public final static int TAB_KEY
- Tab key
UP_ARROW_KEY
public final static int UP_ARROW_KEY
- Up arrow key
DOWN_ARROW_KEY
public final static int DOWN_ARROW_KEY
- Down arrow key
LEFT_ARROW_KEY
public final static int LEFT_ARROW_KEY
- Left arrow key
RIGHT_ARROW_KEY
public final static int RIGHT_ARROW_KEY
- Right arrow key
HOME_KEY
public final static int HOME_KEY
- Home key
END_KEY
public final static int END_KEY
- End key
PAGE_UP_KEY
public final static int PAGE_UP_KEY
- Page up key
PAGE_DOWN_KEY
public final static int PAGE_DOWN_KEY
- Page down key
F1_KEY
public final static int F1_KEY
- F1 Key
F2_KEY
public final static int F2_KEY
- F2 Key
F3_KEY
public final static int F3_KEY
- F3 Key
F4_KEY
public final static int F4_KEY
- F4 Key
F5_KEY
public final static int F5_KEY
- F5 Key
F6_KEY
public final static int F6_KEY
- F6 Key
F7_KEY
public final static int F7_KEY
- F7 Key
F8_KEY
public final static int F8_KEY
- F8 Key
F9_KEY
public final static int F9_KEY
- F9 Key
F10_KEY
public final static int F10_KEY
- F10 Key
F11_KEY
public final static int F11_KEY
- F11 Key
F12_KEY
public final static int F12_KEY
- F12 Key
Constructors
.KeyEvent
public KeyEvent()
- Constructs a KeyEvent.
.KeyEvent
public KeyEvent(long timeStamp,
int key,
int modifiers,
boolean down)
- Constructs a KeyEvent to hold key press information for the
specified key. modifiers is the bitmask representing the
modifier keys held down during the key press. down specifies
whether the event represents a key up or key down event.
Methods
public boolean isExtendedKeyEvent()
- Return whether this event is an extended key event. Extended
key events are available with 1.1 virtual machine and handles
Java virtual keys and unicode characters.
To start receiving extended key events, your application object
instance should override handleExtendedKeyEvent and return true.
public int keyCode()
- Return the virtual key associated with the event.
This value is defined only if isExtendedKeyEvent() returns true
To start receiving extended key events, your application object
instance should override handleExtendedKeyEvent and return true.
public char keyChar()
- Return the unicode character associated with the event.
This value is defined only if isExtendedKeyEvent() returns true
To start receiving extended key events, your application object
instance should override handleExtendedKeyEvent and return true.
public boolean isShiftKeyDown()
- Returns true if the Shift key was held down during the key
event.
public boolean isControlKeyDown()
- Returns true if the Control key was held down during the key
event.
public boolean isMetaKeyDown()
- Returns true if the Meta key was held down during the key event.
public boolean isAltKeyDown()
- Returns true if the Alt key was held down during the key event.
public boolean isReturnKey()
- Returns true if the KeyEvent represents the Return key.
public boolean isBackspaceKey()
- Returns true if the KeyEvent represents the Backspace key.
public boolean isDeleteKey()
- Returns true if the KeyEvent represents the Delete key. In
general, the key used to delete characters is the "Backspace" key in
the upper-right corner of the keyboard (the Mac calls it "Delete").
- See Also:
- isBackspaceKey
public boolean isEscapeKey()
- Returns true if the KeyEvent represents the Escape key.
public boolean isTabKey()
- Returns true if the KeyEvent represents the Tab key.
public boolean isBackTabKey()
- Returns true if the KeyEvent represents the BackTab
(Shift + Tab) key.
public boolean isUpArrowKey()
- Returns true if the KeyEvent represents the Up Arrow key.
public boolean isDownArrowKey()
- Returns true if the KeyEvent represents the Down Arrow key.
public boolean isLeftArrowKey()
- Returns true if the KeyEvent represents the Left Arrow key.
public boolean isRightArrowKey()
- Returns true if the KeyEvent represents the Right Arrow key.
public boolean isArrowKey()
- Returns true if the KeyEvent represents the Arrow key.
public boolean isHomeKey()
- Returns true if the KeyEvent represents the Home key.
public boolean isEndKey()
- Returns true if the KeyEvent represents the End key.
public boolean isPageUpKey()
- Returns true if the KeyEvent represents the Page Up key.
public boolean isPageDownKey()
- Returns true if the KeyEvent represents the Page Down key.
public int isFunctionKey()
- Returns the function key number or 0 if the KeyEvent does not
represent a function key.
public boolean isPrintableKey()
- Returns true if the KeyEvent represents a printable ASCII
character.
public void setRootView(RootView rootView)
- Sets the RootView associated with the KeyEvent.
public RootView rootView()
- Returns the RootView associated with the KeyEvent.
- See Also:
- setRootView
public String toString()
- Returns the KeyEvent's String representation.
- Overrides:
- toString in class Object
All Packages Class Hierarchy This Package Previous Next Index
Copyright © 1997 Netscape Communications Corporation. All rights reserved
Please send any comments or corrections to ifcfeedback@netscape.com
HTML generated on 21 Oct 1997