|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objecteu.webtoolkit.jwt.WKeyEvent
public class WKeyEvent
A class providing details for a keyboard event.
A key event is associated with the WInteractWidget#keyWentDown(), WInteractWidget#keyWentUp() and WInteractWidget#keyPressed() signals.
| Constructor Summary | |
|---|---|
WKeyEvent()
Default constructor. |
|
| Method Summary | |
|---|---|
WAbstractEvent |
createFromJSEvent(eu.webtoolkit.jwt.JavaScriptEvent jsEvent)
Internal method. |
int |
getCharCode()
Returns the unicode character code. |
Key |
getKey()
Returns the key code key that was pressed or released. |
java.util.EnumSet<KeyboardModifier> |
getModifiers()
Returns keyboard modifiers. |
java.lang.String |
getText()
The (unicode) text that this key generated. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public WKeyEvent()
| Method Detail |
|---|
public Key getKey()
The key code corresponds to the actual key on the keyboard, rather than the generated character.
All three types of key events provide this information.
getModifiers(),
getCharCode()public java.util.EnumSet<KeyboardModifier> getModifiers()
The result is a logical OR of KeyboardModifier
flags.
All three types of key events provide this information.
getKey(),
getCharCode()public int getCharCode()
This is only defined for a keyPressed event, and returns the unicode character code of a character
that is entered.
For the keyWentDown and
keyWentUp events, '0' is
returned.
The getCharCode() may be different from
getKey(). For example, a Key_M key may correspond to 'm' or 'M' character,
depending on whether the shift key is pressed simultaneously.
getKey(),
getText()public java.lang.String getText()
This is only defined for a keyPressed event, and returns a string that holds exactly one unicode
character, which corresponds to getCharCode().
For the keyWentDown and
keyWentUp events, an empty string is
returned.
getCharCode()public WAbstractEvent createFromJSEvent(eu.webtoolkit.jwt.JavaScriptEvent jsEvent)
WAbstractEvent
createFromJSEvent in interface WAbstractEvent
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||