@Deprecated public class KeyboardListenerAdapter extends Object implements KeyboardListener
KEY_ALT, KEY_BACKSPACE, KEY_CTRL, KEY_DELETE, KEY_DOWN, KEY_END, KEY_ENTER, KEY_ESCAPE, KEY_HOME, KEY_LEFT, KEY_PAGEDOWN, KEY_PAGEUP, KEY_RIGHT, KEY_SHIFT, KEY_TAB, KEY_UP, MODIFIER_ALT, MODIFIER_CTRL, MODIFIER_META, MODIFIER_SHIFT
Constructor and Description |
---|
KeyboardListenerAdapter()
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
void |
onKeyDown(Widget sender,
char keyCode,
int modifiers)
Deprecated.
Fired when the user depresses a physical key.
|
void |
onKeyPress(Widget sender,
char keyCode,
int modifiers)
Deprecated.
Fired when a keyboard action generates a character.
|
void |
onKeyUp(Widget sender,
char keyCode,
int modifiers)
Deprecated.
Fired when the user releases a physical key.
|
public void onKeyDown(Widget sender, char keyCode, int modifiers)
KeyboardListener
onKeyDown
in interface KeyboardListener
sender
- the widget that was focused when the event occurred.keyCode
- the physical key that was depressed. Constants for this
value are defined in this interface with the KEY prefix.modifiers
- the modifier keys pressed at when the event occurred. This
value is a combination of the bits defined by
KeyboardListener.MODIFIER_SHIFT
,
KeyboardListener.MODIFIER_CTRL
, and
KeyboardListener.MODIFIER_ALT
public void onKeyPress(Widget sender, char keyCode, int modifiers)
KeyboardListener
It should be noted that many browsers do not generate keypress events for
non-printing keyCode values, such as KeyboardListener.KEY_ENTER
or
arrow keys. These keyCodes can be reliably captured either with
KeyboardListener.onKeyDown(Widget, char, int)
or
KeyboardListener.onKeyUp(Widget, char, int)
.
onKeyPress
in interface KeyboardListener
sender
- the widget that was focused when the event occurred.keyCode
- the Unicode character that was generated by the keyboard
action.modifiers
- the modifier keys pressed at when the event occurred. This
value is a combination of the bits defined by
KeyboardListener.MODIFIER_SHIFT
,
KeyboardListener.MODIFIER_CTRL
, and
KeyboardListener.MODIFIER_ALT
public void onKeyUp(Widget sender, char keyCode, int modifiers)
KeyboardListener
onKeyUp
in interface KeyboardListener
sender
- the widget that was focused when the event occurred.keyCode
- the physical key that was released. Constants for this value
are defined in this interface with the KEY prefix.modifiers
- the modifier keys pressed at when the event occurred. This
value is a combination of the bits defined by
KeyboardListener.MODIFIER_SHIFT
,
KeyboardListener.MODIFIER_CTRL
, and
KeyboardListener.MODIFIER_ALT
Copyright © 2016. All rights reserved.