Package org.htmlunit.html
Class Keyboard
- java.lang.Object
-
- org.htmlunit.html.Keyboard
-
public class Keyboard extends java.lang.ObjectKeeps track of the typed keys.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()Clears all keys.booleanisStartAtEnd()Returns whether typing should start at the text end or not.voidpress(int keyCode)Press the specified key code (without releasing it).voidrelease(int keyCode)Releases the specified key code.voidtype(char ch)Types the specified character.
-
-
-
Method Detail
-
type
public void type(char ch)
Types the specified character.- Parameters:
ch- the character
-
press
public void press(int keyCode)
Press the specified key code (without releasing it).An example of predefined values is
KeyboardEvent.DOM_VK_PAGE_DOWN.- Parameters:
keyCode- the key code
-
release
public void release(int keyCode)
Releases the specified key code.An example of predefined values is
KeyboardEvent.DOM_VK_PAGE_DOWN.- Parameters:
keyCode- the key code.
-
clear
public void clear()
Clears all keys.
-
isStartAtEnd
public boolean isStartAtEnd()
Returns whether typing should start at the text end or not.- Returns:
- whether typing should start at the text end or not
-
-