public class KeyEvent2
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
ALT
The mask for "shift".
|
static int |
ALT_GRAPH
The mask for "alt_graph".
|
static int |
CTRL
The mask for "ctrl".
|
private char |
keyChar
The key as a char value.
|
private int |
keyCode
The key code.
|
static int |
MASK
The mask for all used modifiers.
|
static int |
META
The mask for "meta".
|
private int |
modifiers
The modifiers.
|
static int |
NONE
The mask for "no modifier".
|
static int |
SHIFT
The mask for "shift".
|
Constructor and Description |
---|
KeyEvent2(int keyCode,
char keyChar,
int modifiers)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj) |
boolean |
equalsKeyCode(KeyEvent2 keyEvent)
Returns whether this key event matches the same key code as another key
event.
|
char |
getKeyChar()
Returns the key as a char.
|
int |
getKeyCode()
Returns the key code.
|
int |
getModifiers()
Returns the modifiers.
|
int |
hashCode() |
java.lang.String |
toString() |
public static final int ALT
public static final int ALT_GRAPH
public static final int CTRL
private final char keyChar
private final int keyCode
VK_xxx
constants.public static final int MASK
public static final int META
private final int modifiers
public static final int NONE
public static final int SHIFT
public KeyEvent2(int keyCode, char keyChar, int modifiers)
keyCode
- the key codekeyChar
- the key as a charmodifiers
- the modifierspublic boolean equals(@Nullable java.lang.Object obj)
equals
in class java.lang.Object
public boolean equalsKeyCode(@NotNull KeyEvent2 keyEvent)
keyEvent
- the other key eventpublic char getKeyChar()
public int getKeyCode()
VK_xxx
constants.public int getModifiers()
public int hashCode()
hashCode
in class java.lang.Object
@NotNull public java.lang.String toString()
toString
in class java.lang.Object