Share via


Overview | Methods | Fields | This Package | All Packages

OverviewMethodsFieldsThis PackageAll Packages

Control.addOnKeyDown

Assigns a delegate to the keyDown event.

Syntax

public final void addOnKeyDown( KeyEventHandler value )

Parameters

value

The KeyEventHandler delegate to be notified when the event occurs.

Remarks

Passing an event handler as a parameter to this method is equivalent to setting the keyDown event to that method in the Properties window. The keyDown event occurs when the user presses a key while this control has the focus. You can retrieve the virtual key code for the key that was pressed using the getKeyCode method of the KeyEvent object that is sent with this event. The Key class contains constants that represent possible virtual key codes.

See Also   removeOnKeyDown