org.sikuli.api.robot.desktop
Class DesktopKeyboard

java.lang.Object
  extended by org.sikuli.api.robot.desktop.DesktopKeyboard
All Implemented Interfaces:
Keyboard

public class DesktopKeyboard
extends Object
implements Keyboard


Constructor Summary
DesktopKeyboard()
           
 
Method Summary
 String copy()
          Clears the clipboard, performs the "copy" keyboard shortcut, then attempts to return the clipboard contents as a String.
 void copyRegion(ScreenRegion screenRegion)
          Copies the content of a screen region into the clipboard.
 void keyDown(int keycode)
          press down the key (given by the key code) on the underlying device.
 void keyDown(String keys)
          Presses down a series of keys specified by the String argument keys.
 void keyUp()
          Releases all the held down keys.
 void keyUp(int keycode)
          release the key (given by the key code) on the underlying device.
 void keyUp(String keys)
          Releases a series of keys specified by the String argument keys.
 void paste(String text)
          Gets plain text from the clipboard and performs the "paste" keyboard shortcut.
 void type(String text)
          Performs keyboard typing of the text specified by the arguments of the same name.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DesktopKeyboard

public DesktopKeyboard()
Method Detail

copy

public String copy()
Description copied from interface: Keyboard
Clears the clipboard, performs the "copy" keyboard shortcut, then attempts to return the clipboard contents as a String. Returns null if the clipboard couldn't be converted to a string or was empty.

Specified by:
copy in interface Keyboard
Returns:
The clipboard contents converted to a String or null

copyRegion

public void copyRegion(ScreenRegion screenRegion)
Description copied from interface: Keyboard
Copies the content of a screen region into the clipboard. It highlights the content of the given screen region by clicking on its upper-left corner and moving the mouse to the lower-right corner, then it performs the keyboard shortcut to copy the content of the screen region.

Specified by:
copyRegion in interface Keyboard
Parameters:
screenRegion - The screen region to be copied

paste

public void paste(String text)
Description copied from interface: Keyboard
Gets plain text from the clipboard and performs the "paste" keyboard shortcut.

Specified by:
paste in interface Keyboard
Parameters:
text - the text to paste

type

public void type(String text)
Description copied from interface: Keyboard
Performs keyboard typing of the text specified by the arguments of the same name. It presses and releases the given keys.

Specified by:
type in interface Keyboard
Parameters:
text - the keys to type

keyDown

public void keyDown(int keycode)
press down the key (given by the key code) on the underlying device. The code depend on the type of the device.

Specified by:
keyDown in interface Keyboard
Parameters:
keycode - Key to press down (e.g. KeyEvent.VK_A)

keyUp

public void keyUp(int keycode)
release the key (given by the key code) on the underlying device. The code depend on the type of the device.

Specified by:
keyUp in interface Keyboard
Parameters:
keycode - Key to release

keyDown

public void keyDown(String keys)
Description copied from interface: Keyboard
Presses down a series of keys specified by the String argument keys. The keys should be released using the Keyboard.keyUp(String) method.

Specified by:
keyDown in interface Keyboard
Parameters:
keys - the keys to be typed down.

keyUp

public void keyUp()
Description copied from interface: Keyboard
Releases all the held down keys.

Specified by:
keyUp in interface Keyboard

keyUp

public void keyUp(String keys)
Description copied from interface: Keyboard
Releases a series of keys specified by the String argument keys. The keys depend on the type of the device.

Specified by:
keyUp in interface Keyboard
Parameters:
keys - the keys to release.


Copyright © 2014. All rights reserved.