public class KeyPopupTrigger extends PopupTrigger
PopupTrigger
for key events.
Valid key event ids are those, that are re-declared in this class:
KEY_PRESSED
and KEY_RELEASED
.
Valid keys are a subset of the virtual key code constants declared in class
KeyEvent
. Supported are those, that are re-declared in this class.
Method isKeySupported
determines, whether a certain key code
constant is supported or not.
Basically, the set of supported key codes contains those:
KeyEvent.isActionKey
returns
true
In other words, a key popup trigger can be registered for
action keys
available on the Windows platform, which are not
related to extended input methods.
Modifier and Type | Field and Description |
---|---|
static int |
KEY_FIRST
The first number in the range of ids used for key events with this popup
trigger.
|
static int |
KEY_LAST
The last number in the range of ids used for key events with this popup
trigger.
|
static int |
KEY_PRESSED
The "key pressed" event.
|
static int |
KEY_RELEASED
The "key released" event.
|
static int |
VK_BEGIN |
static int |
VK_CAPS_LOCK |
static int |
VK_CONTEXT_MENU |
static int |
VK_DOWN |
static int |
VK_END |
static int |
VK_F1 |
static int |
VK_F10 |
static int |
VK_F11 |
static int |
VK_F12 |
static int |
VK_F13 |
static int |
VK_F14 |
static int |
VK_F15 |
static int |
VK_F16 |
static int |
VK_F17 |
static int |
VK_F18 |
static int |
VK_F19 |
static int |
VK_F2 |
static int |
VK_F20 |
static int |
VK_F21 |
static int |
VK_F22 |
static int |
VK_F23 |
static int |
VK_F24 |
static int |
VK_F3 |
static int |
VK_F4 |
static int |
VK_F5 |
static int |
VK_F6 |
static int |
VK_F7 |
static int |
VK_F8 |
static int |
VK_F9 |
static int |
VK_HELP |
static int |
VK_HOME |
static int |
VK_INSERT |
static int |
VK_KP_DOWN |
static int |
VK_KP_LEFT |
static int |
VK_KP_RIGHT |
static int |
VK_KP_UP |
static int |
VK_LEFT |
static int |
VK_NUM_LOCK |
static int |
VK_PAGE_DOWN |
static int |
VK_PAGE_UP |
static int |
VK_PAUSE |
static int |
VK_PRINTSCREEN |
static int |
VK_RIGHT |
static int |
VK_SCROLL_LOCK |
static int |
VK_UP |
static int |
VK_WINDOWS |
eventId, key
Constructor and Description |
---|
KeyPopupTrigger(int eventId,
int keyCode)
Initializes a
KeyPopupTrigger with the specified event id
and key code constant. |
Modifier and Type | Method and Description |
---|---|
int |
getKeyCode()
Returns this key popup trigger's key code constant.
|
int[] |
getNativeKeys()
Returns the native keys as an array of integers.
|
static boolean |
isKeySupported(int keyCode)
Determines whether the specified key code is supported by a
KeyPopupTrigger . |
static KeyPopupTrigger |
valueOf(int eventId,
int keyCode)
Returns a
KeyPopupTrigger instance representing the
specified event id and key code constant. |
equals, getEventId, getKey, hashCode
public static final int KEY_FIRST
public static final int KEY_LAST
public static final int KEY_PRESSED
public static final int KEY_RELEASED
public static final int VK_HOME
public static final int VK_END
public static final int VK_PAGE_UP
public static final int VK_PAGE_DOWN
public static final int VK_UP
public static final int VK_DOWN
public static final int VK_LEFT
public static final int VK_RIGHT
public static final int VK_BEGIN
public static final int VK_KP_LEFT
public static final int VK_KP_UP
public static final int VK_KP_RIGHT
public static final int VK_KP_DOWN
public static final int VK_F1
public static final int VK_F2
public static final int VK_F3
public static final int VK_F4
public static final int VK_F5
public static final int VK_F6
public static final int VK_F7
public static final int VK_F8
public static final int VK_F9
public static final int VK_F10
public static final int VK_F11
public static final int VK_F12
public static final int VK_F13
public static final int VK_F14
public static final int VK_F15
public static final int VK_F16
public static final int VK_F17
public static final int VK_F18
public static final int VK_F19
public static final int VK_F20
public static final int VK_F21
public static final int VK_F22
public static final int VK_F23
public static final int VK_F24
public static final int VK_PRINTSCREEN
public static final int VK_SCROLL_LOCK
public static final int VK_CAPS_LOCK
public static final int VK_NUM_LOCK
public static final int VK_PAUSE
public static final int VK_INSERT
public static final int VK_HELP
public static final int VK_WINDOWS
public static final int VK_CONTEXT_MENU
public KeyPopupTrigger(int eventId, int keyCode)
KeyPopupTrigger
with the specified event id
and key code constant.
The supported event ids are a subset of the key event ids declared in
class KeyEvent
. Actually, only those event ids re-declared
in this class, are the supported ones: KEY_PRESSED
and
KEY_RELEASED
. Specifying any other event id results in an
IllegalArgumentException
.
The supported key code constants ids are a subset of the key code
constants declared in class KeyEvent
. Actually, only those
key code constants re-declared in this class, are the supported ones.
Method isKeySupported
determines, whether a certain key code
constant is supported. Specifying an unsupported key code constant
results in an IllegalArgumentException
.
Basically, the set of supported key codes contains those:
KeyEvent.isActionKey
returns
true
In other words, a key popup trigger can be registered for
action keys
available on the Windows platform, which are not
related to extended input methods.
eventId
- the eventId of the new key popup triggerkeyCode
- the key code constant of the new key popup triggerIllegalArgumentException
- if any of the specified arguments is invalidisKeySupported(int)
,
KeyEvent
,
KeyEvent.isActionKey()
public static KeyPopupTrigger valueOf(int eventId, int keyCode)
KeyPopupTrigger
instance representing the
specified event id and key code constant. This method uses a cache, so
that different requests for key popup triggers with the same event ids
and key code constants return the same trigger instance.
The supported event ids are a subset of the key event ids declared in
class KeyEvent
. Actually, only those event ids re-declared
in this class, are the supported ones: KEY_PRESSED
and
KEY_RELEASED
. Specifying any other event id results in an
IllegalArgumentException
.
The supported key code constants ids are a subset of the key code
constants declared in class KeyEvent
. Actually, only those
key code constants re-declared in this class, are the supported ones.
Method isKeySupported
determines, whether a certain key code
constant is supported. Specifying an unsupported key code constant
results in an IllegalArgumentException
.
Basically, the set of supported key codes contains those:
KeyEvent.isActionKey
returns
true
In other words, a key popup trigger can be registered for
action keys
available on the Windows platform, which are not
related to extended input methods.
eventId
- the eventId of the new key popup triggerkeyCode
- the key code constant of the new key popup triggerKeyPopupTrigger
instance representing the
specified event id and key code constantIllegalArgumentException
- if any of the specified arguments is invalidKeyEvent
,
KeyEvent.isActionKey()
public int getKeyCode()
public int[] getNativeKeys()
PopupTrigger
getNativeKeys
in class PopupTrigger
public static boolean isKeySupported(int keyCode)
KeyPopupTrigger
.keyCode
- the key code to testtrue
if the spefified key code is supported by a
KeyPopupTrigger
; false
otherwiseCopyright © 2009 - 2016 DataGis. All Rights Reserved.