Interface KeyCallback


public interface KeyCallback

This interface represents a function prototype for a key action.

A custom key callback function can be supplied for example for Shell.setKeyHandler(KeyCallback). Key event handling can be redirected this way to custom code.

If the key callback function is not given the default Script.keyAction(Component, int, int) is called.

See Also:
Shell.setKeyHandler(KeyCallback), Callbacks

Method Summary
 boolean keyAction(Component source, int op, int code)
          Called when key event has occurred.
 

Method Detail

keyAction

boolean keyAction(Component source,
                  int op,
                  int code)
Called when key event has occurred.

Parameters:
source - Currently focused component
op - Operation that has occurred: KEY_PRESSED, KEY_RELEASED, KEY_REPEATED
code - unicode value of key (>=0) or special key code (<0) for other keys
Returns:
true if key event was consumed and should not be processed anywhere else
See Also:
KEY_UP, KEY_DOWN, KEY_LEFT, KEY_RIGHT, KEY_FIRE, KEY_ESC, KEY_ENTER, KEY_CR, KEY_DELETE, KEY_BACKSPACE, KEY_TAB, KEY_OK, KEY_BACK