|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.fest.swing.core.KeyPressInfo
public final class KeyPressInfo
Understands information about pressing a keyboard key.
Examples:
Specify that 'CTRL' + 'C' should be pressed:
// import static org.fest.swing.fixture.KeyPressInfo.*; KeyPressInfo i = key(VK_C).modifiers(CTRL_MASK);
Specify that 'SHIFT' + 'R' should be pressed:
// import static org.fest.swing.fixture.KeyPressInfo.*; KeyPressInfo i = key(VK_R).modifiers(SHIFT_MASK);
For platform-safe mask pressing (e.g. 'Control' in Windows or 'Command' in MacOS) use
.
Platform.controlOrCommandMask()
Method Summary | |
---|---|
int |
keyCode()
Returns the code of the key to press. |
static KeyPressInfo |
keyCode(int keyCode)
Specifies the code of the key to press, without any modifiers (e.g. |
int[] |
modifiers()
Returns the modifiers to use when pressing . |
KeyPressInfo |
modifiers(int... newModifiers)
Specifies the modifiers to use when pressing (e.g. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static KeyPressInfo keyCode(int keyCode)
KeyEvent.VK_C
.)
keyCode
- the code of the key to press.
KeyPressInfo
.public int keyCode()
public int[] modifiers()
the specified key
.
public KeyPressInfo modifiers(int... newModifiers)
the specified key
(e.g.
Event.CTRL_MASK
.)
For platform-safe mask pressing (e.g. 'Control' in Windows or 'Command' in MacOS) use
.
Platform.controlOrCommandMask()
newModifiers
- the new modifiers to use.
NullPointerException
- if newModifiers
is null
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |