APIdia Launch Partner
Top Description Fields Constructors Methods
com.sun.glass.ui.monocle

pack-priv Class KeyState

extends Object
Class Inheritance
Imports
com.sun.glass.events.KeyEvent

KeyState is a snapshot of pressed keys KeyState is used both to store the current state of key input and to describe changes to that state.

Field Summary

Modifier and TypeField and Description
private IntSet
private int
private MonocleWindow

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
pack-priv void
clear()

Removes all pressed keys from this state object.

pack-priv void
copyTo(KeyState
The KeyState to which to copy this state's data.
target
)

Copies the contents of this state object to another.

pack-priv IntSet

Returns:

an IntSet containing the key codes of pressed keys
getKeysPressed
()

Returns the set of pressed key codes

private static int
getModifier(int virtualKeyCode)

pack-priv int

Returns:

a mask of KeyEvent modifiers
getModifiers
()

Returns a mask of modifiers defined in KeyEvent for the keys pressed in this state.

pack-priv MonocleWindow
getWindow(boolean recalculateCache)

Returns the Glass window on which this event state is located .

pack-priv boolean
pack-priv boolean
pack-priv void
pressKey(int virtualKeyCode)

Adds a key to the set of pressed keys.

pack-priv void
releaseKey(int virtualKeyCode)

Removes a key from the set of pressed keys.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

keysPressedback to summary
private IntSet keysPressed
modifiersback to summary
private int modifiers
windowback to summary
private MonocleWindow window

Constructor Detail

KeyStateback to summary
pack-priv KeyState()

Method Detail

clearback to summary
pack-priv void clear()

Removes all pressed keys from this state object.

copyToback to summary
pack-priv void copyTo(KeyState target)

Copies the contents of this state object to another.

Parameters
target:KeyState

The KeyState to which to copy this state's data.

getKeysPressedback to summary
pack-priv IntSet getKeysPressed()

Returns the set of pressed key codes

Returns:IntSet

an IntSet containing the key codes of pressed keys

getModifierback to summary
private static int getModifier(int virtualKeyCode)
getModifiersback to summary
pack-priv int getModifiers()

Returns a mask of modifiers defined in KeyEvent for the keys pressed in this state.

Returns:int

a mask of KeyEvent modifiers

getWindowback to summary
pack-priv MonocleWindow getWindow(boolean recalculateCache)

Returns the Glass window on which this event state is located .

isControlPressedback to summary
pack-priv boolean isControlPressed()
isShiftPressedback to summary
pack-priv boolean isShiftPressed()
pressKeyback to summary
pack-priv void pressKey(int virtualKeyCode)

Adds a key to the set of pressed keys.

releaseKeyback to summary
pack-priv void releaseKey(int virtualKeyCode)

Removes a key from the set of pressed keys.

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Annotations
@Override