Package jexer.event
Class TKeypressEvent
- java.lang.Object
-
- jexer.event.TInputEvent
-
- jexer.event.TKeypressEvent
-
public class TKeypressEvent extends TInputEvent
This class encapsulates a keyboard input event.
-
-
Constructor Summary
Constructors Constructor Description TKeypressEvent(Backend backend, boolean isKey, int fnKey, int ch, boolean alt, boolean ctrl, boolean shift)
Public constructor.TKeypressEvent(Backend backend, TKeypress key)
Public contructor.TKeypressEvent(Backend backend, TKeypress key, boolean alt, boolean ctrl, boolean shift)
Public constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TKeypressEvent
dup()
Create a duplicate instance.boolean
equals(java.lang.Object rhs)
Comparison check.TKeypress
getKey()
Get keystroke.int
hashCode()
Hashcode uses all fields in equals().java.lang.String
toString()
Make human-readable description of this TKeypressEvent.-
Methods inherited from class jexer.event.TInputEvent
getBackend, getTime
-
-
-
-
Constructor Detail
-
TKeypressEvent
public TKeypressEvent(Backend backend, TKeypress key)
Public contructor.- Parameters:
backend
- the backend that generated this eventkey
- the TKeypress received
-
TKeypressEvent
public TKeypressEvent(Backend backend, boolean isKey, int fnKey, int ch, boolean alt, boolean ctrl, boolean shift)
Public constructor.- Parameters:
backend
- the backend that generated this eventisKey
- is true, this is a function keyfnKey
- the function key code (only valid if isKey is true)ch
- the character (only valid if fnKey is false)alt
- if true, ALT was pressed with this keystrokectrl
- if true, CTRL was pressed with this keystrokeshift
- if true, SHIFT was pressed with this keystroke
-
TKeypressEvent
public TKeypressEvent(Backend backend, TKeypress key, boolean alt, boolean ctrl, boolean shift)
Public constructor.- Parameters:
backend
- the backend that generated this eventkey
- the TKeypress receivedalt
- if true, ALT was pressed with this keystrokectrl
- if true, CTRL was pressed with this keystrokeshift
- if true, SHIFT was pressed with this keystroke
-
-
Method Detail
-
equals
public boolean equals(java.lang.Object rhs)
Comparison check. All fields must match to return true.- Overrides:
equals
in classjava.lang.Object
- Parameters:
rhs
- another TKeypressEvent or TKeypress instance- Returns:
- true if all fields are equal
-
hashCode
public int hashCode()
Hashcode uses all fields in equals().- Overrides:
hashCode
in classjava.lang.Object
- Returns:
- the hash
-
toString
public java.lang.String toString()
Make human-readable description of this TKeypressEvent.- Overrides:
toString
in classjava.lang.Object
- Returns:
- displayable String
-
getKey
public TKeypress getKey()
Get keystroke.- Returns:
- keystroke
-
dup
public TKeypressEvent dup()
Create a duplicate instance.- Returns:
- duplicate intance
-
-