|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eclipse.swtbot.swt.finder.keyboard.Keyboard
public class Keyboard
Represents a Keyboard. Allows for typing keys and pressing shortcuts. Pressing shortcuts is different from pressing normal characters and 'special characters'.
NOTE: This class needs that a KeyStroke
be split. This means that a single KeyStroke
representing a SHIFT+T needs to be split into two KeyStroke
s, one representing a SHIFT and another
representing a 'T'.
Shortcut: CTRL+SHIFT+T for e.g. needs to press CTRL, SHIFT, T in that order while holding them down, and release them in the order T, SHIFT, CTRL.
Normal characters: 't' requires that you type 'T'. 'T' requires that you type the shortcut SHIFT+T.
Special characters: On a US keyboard '#' requires that you type SHIFT+3. ':' requires you to type SHIFT+;.
Keystrokes.toKeys(int, char)
Constructor Summary | |
---|---|
Keyboard(KeyboardStrategy strategy)
Creates a new keyboard that uses the specified strategy to type on the keyboard. |
Method Summary | |
---|---|
void |
pressShortcut(int modificationKeys,
char c)
Presses the shortcut specified by the given keys. |
void |
pressShortcut(int modificationKeys,
int keyCode,
char c)
Presses the shortcut specified by the given keys. |
void |
pressShortcut(KeyStroke... keys)
Presses the shortcut specified by the given keys. |
void |
typeCharacter(char ch)
Types the character on the keyboard. |
void |
typeText(String text)
Types the string on the keyboard. |
void |
typeText(String text,
int interval)
Types the string on the keyboard. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Keyboard(KeyboardStrategy strategy)
strategy
- the keyboard strategy.Method Detail |
---|
public void typeText(String text)
text
- the text to type on the keyboard.public void typeText(String text, int interval)
text
- the text to type on the keyboard.interval
- the interval between the keystrokes.public void typeCharacter(char ch)
ch
- the character to type on the keyboard.public void pressShortcut(int modificationKeys, char c)
modificationKeys
- the combination of SWT.ALT
| SWT.CTRL
| SWT.SHIFT
|
SWT.COMMAND
.c
- the characterKeystrokes.toKeys(int, char)
public void pressShortcut(KeyStroke... keys)
keys
- the keys to pressKeystrokes.toKeys(int, char)
public void pressShortcut(int modificationKeys, int keyCode, char c)
modificationKeys
- the combination of SWT.ALT
| SWT.CTRL
| SWT.SHIFT
|
SWT.COMMAND
.keyCode
- the keyCode, these may be special keys like F1-F12, or navigation keys like HOME, PAGE_UPc
- the characterKeystrokes.toKeys(int, char)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |