public class KeyInput extends Event
Modifier and Type | Field and Description |
---|---|
private int |
actionCode
Progress like action code or KeyInput.CHAR_UNDEFINED
|
private boolean |
causedAutoReturn
true if this event generated a downstream AUTO-RETURN. |
static int |
CHAR_ALT_KEY_BIT
Bit mask used to integrate ALT key down flag into key code.
|
static char |
CHAR_UNDEFINED
Undefined character constant.
|
private boolean |
eventMode
A flag which may have varying meaning depending on the event code.
|
private boolean |
isKey
Mark real keys typed by user.
|
private int |
key
Key associated with the event.
|
private int |
keyState
State of extended keys: Alt, Ctrl, Shift, Meta.
|
private boolean |
mouse
true if the event was caused by a mouse event. |
private boolean |
skipActivation
Depending on the flag value the window activation event will or will not be sent when ENTRY event is
dispatched.
|
static int |
STATE_ALT_KEY_BIT
Integer value to be used to check if the ALT key is down.
|
private boolean |
triggerFired
If
true , a trigger has fired in reaction to this event. |
private boolean |
validationError
Flag used by some events to indicate widget display value validation error
|
Constructor and Description |
---|
KeyInput(Widget source,
int id)
Constructor for MouseEvt compatibility.
|
KeyInput(Widget source,
int id,
int key)
Initializes the action code to the Mapped Progress key action.
|
KeyInput(Widget source,
int id,
int key,
boolean eventMode)
Initializes the action code to the Mapped Progress key action.
|
KeyInput(Widget src,
int id,
int key,
boolean mode,
boolean isKey)
Initializes the action code to the Mapped Progress key action.
|
KeyInput(Widget source,
Widget other,
int id,
int key,
boolean eventMode)
Initializes the action code to the Mapped Progress key action.
|
KeyInput(Widget src,
Widget other,
int id,
int key,
boolean mode,
boolean isKey,
boolean skipActivation)
Initializes the action code to the Mapped Progress key action.
|
KeyInput(Widget src,
Widget other,
int id,
int key,
boolean mode,
boolean isKey,
boolean skipActivation,
boolean mouse,
int keyState)
Initializes the action code to the Mapped Progress key action.
|
Modifier and Type | Method and Description |
---|---|
int |
actionCode()
Returns the integer action code.
|
boolean |
canProduceAction()
An action should be produced only in one of the next scenarios
1.
|
void |
dispatch(KeyListener listener)
Invoke appropriate listeners' method depending on the event type.
|
int |
getKeyState()
Returns extended keys state for this event.
|
boolean |
isCausedAutoReturn()
Reports if this event generated an AUTO-RETURN.
|
boolean |
isMouse()
Returns
true if the event was caused by a mouse event. |
boolean |
isRealKey()
Return
true if event represents key typed by user (as
opposed to some kind of artificially generated event). |
boolean |
isSkipActivation()
Getter for the skip activation flag.
|
boolean |
isSpecial()
Returns the special mode flag.
|
boolean |
isTriggerFired()
Check if a trigger has fired in reaction to this event
|
boolean |
isValidationError()
Returns the value of the validation error flag.
|
char |
keyChar()
Get character for this event.
|
int |
keyCode()
Get key code for this event.
|
void |
print(PrintHelper printer)
Print all class-specific fields.
|
void |
setActionCode(int code)
Sets the action code.
|
void |
setCausedAutoReturn(boolean causedAutoReturn)
Sets the flag reporting if this event generated an AUTO-RETURN.
|
void |
setKeyCode(int key)
Set key code for this event.
|
void |
setKeyState(int state)
Set extended keys state for this event.
|
void |
setTriggerFired()
Mark that a trigger has fired in reaction to this event.
|
void |
setValidationError(boolean validationError)
Sets the validation error flag.
|
consume, id, isConsumed, other, source, toString
private int actionCode
private boolean eventMode
private boolean isKey
private boolean triggerFired
true
, a trigger has fired in reaction to this event.private int key
private int keyState
private boolean causedAutoReturn
true
if this event generated a downstream AUTO-RETURN.private boolean skipActivation
private boolean mouse
true
if the event was caused by a mouse event. Applies only to synthetic event.private boolean validationError
public static final char CHAR_UNDEFINED
public static final int STATE_ALT_KEY_BIT
public static final int CHAR_ALT_KEY_BIT
public KeyInput(Widget source, int id, int key)
source
- widget associated with the eventid
- event categorykey
- event codepublic KeyInput(Widget source, int id, int key, boolean eventMode)
source
- widget associated with the eventid
- event categorykey
- event codeeventMode
- a boolean flag specific to the eventpublic KeyInput(Widget source, Widget other, int id, int key, boolean eventMode)
source
- widget associated with the eventother
- companion widget associated with the eventid
- event categorykey
- event codeeventMode
- a boolean flag specific to the eventpublic KeyInput(Widget src, int id, int key, boolean mode, boolean isKey)
src
- widget associated with the eventid
- event categorykey
- event codemode
- a boolean flag specific to the eventisKey
- mark real key typed by userpublic KeyInput(Widget src, Widget other, int id, int key, boolean mode, boolean isKey, boolean skipActivation)
src
- widget associated with the eventother
- companion widget associated with the eventid
- event categorykey
- event codemode
- a boolean flag specific to the eventisKey
- mark real key typed by userskipActivation
- Skip activation flag. Depending on the flag value the window activation event will or
will not be sent when ENTRY event is dispatched.public KeyInput(Widget src, Widget other, int id, int key, boolean mode, boolean isKey, boolean skipActivation, boolean mouse, int keyState)
src
- widget associated with the eventother
- companion widget associated with the eventid
- event categorykey
- event codemode
- a boolean flag specific to the eventisKey
- mark real key typed by userskipActivation
- Skip activation flag. Depending on the flag value the window activation event will or
will not be sent when ENTRY event is dispatched.mouse
- true
if the event was caused by a mouse event.keyState
- the key state, see keyState
public KeyInput(Widget source, int id)
source
- Event source.id
- Event type ID.public int actionCode()
public void setActionCode(int code)
code
- new action code to be setpublic boolean isSpecial()
public boolean isRealKey()
true
if event represents key typed by user (as
opposed to some kind of artificially generated event).true
if event was generated by real user input.public void dispatch(KeyListener listener)
listener
- Event listener to which event will be passed.public void setTriggerFired()
public char keyChar()
CHAR_UNDEFINED
is returned.public int keyCode()
public boolean isTriggerFired()
true
if a trigger has fired in reaction to this event.public void setKeyCode(int key)
key
- Key code to set.public int getKeyState()
public void setKeyState(int state)
state
- The state to assign. For the bit layout see
KeyCode
.public void setCausedAutoReturn(boolean causedAutoReturn)
causedAutoReturn
- true
if this event generated a downstream AUTO-RETURN.public boolean isCausedAutoReturn()
true
if this event generated a downstream AUTO-RETURN.public boolean isSkipActivation()
public boolean isMouse()
true
if the event was caused by a mouse event. Applicable only to synthetic
events.true
if the event was caused by a mouse event.public boolean isValidationError()
public void setValidationError(boolean validationError)
validationError
- The new value.public boolean canProduceAction()
public void print(PrintHelper printer)