public class PBasicInputEventHandler extends Object implements PInputEventListener
Constructor and Description |
---|
PBasicInputEventHandler()
Constructs a PBasicInputEventHandler with a wide open event filter.
|
Modifier and Type | Method and Description |
---|---|
boolean |
acceptsEvent(PInputEvent event,
int type)
Returns true if the event would be dispatched if passed to processEvent.
|
PInputEventFilter |
getEventFilter()
Returns the event filter responsible for filtering incoming events.
|
void |
keyboardFocusGained(PInputEvent event)
This method is invoked when a node gains the keyboard focus.
|
void |
keyboardFocusLost(PInputEvent event)
This method is invoked when a node loses the keyboard focus.
|
void |
keyPressed(PInputEvent event)
Will get called whenever a key has been pressed down.
|
void |
keyReleased(PInputEvent event)
Will get called whenever a key has been released.
|
void |
keyTyped(PInputEvent event)
Will be called at the end of a full keystroke (down then up).
|
void |
mouseClicked(PInputEvent event)
Will be called at the end of a full click (mouse pressed followed by
mouse released).
|
void |
mouseDragged(PInputEvent event)
Will be called when a drag is occurring.
|
void |
mouseEntered(PInputEvent event)
Will be invoked when the mouse enters a specified region.
|
void |
mouseExited(PInputEvent event)
Will be invoked when the mouse leaves a specified region.
|
void |
mouseMoved(PInputEvent event)
Will be called when the mouse is moved.
|
void |
mousePressed(PInputEvent event)
Will be called when a mouse button is pressed down.
|
void |
mouseReleased(PInputEvent event)
Will be called when any mouse button is released.
|
void |
mouseWheelRotated(PInputEvent event)
This method is invoked when the mouse wheel is rotated.
|
void |
mouseWheelRotatedByBlock(PInputEvent event)
This method is invoked when the mouse wheel is rotated by a block.
|
void |
processEvent(PInputEvent event,
int type)
Dispatches a generic event to a more specific method.
|
void |
setEventFilter(PInputEventFilter newEventFilter)
Changes this event handler's filter to the one provided.
|
public PBasicInputEventHandler()
public void processEvent(PInputEvent event, int type)
processEvent
in interface PInputEventListener
event
- the event to be dispatchedtype
- Swing event type of the underlying Swing eventpublic boolean acceptsEvent(PInputEvent event, int type)
event
- event being tested for acceptancetype
- Swing event type of underlying swing eventpublic PInputEventFilter getEventFilter()
public void setEventFilter(PInputEventFilter newEventFilter)
newEventFilter
- filter to use for this input event handlerpublic void keyPressed(PInputEvent event)
event
- the event representing the keystrokepublic void keyReleased(PInputEvent event)
event
- the event representing the keystrokepublic void keyTyped(PInputEvent event)
event
- object which can be queried for the event's detailspublic void mouseClicked(PInputEvent event)
event
- object which can be queried for the event's detailspublic void mousePressed(PInputEvent event)
event
- object which can be queried for the event's detailspublic void mouseDragged(PInputEvent event)
event
- object which can be queried for the event's detailspublic void mouseEntered(PInputEvent event)
event
- object which can be queried for the event's detailspublic void mouseExited(PInputEvent event)
event
- object which can be queried for the event's detailspublic void mouseMoved(PInputEvent event)
event
- object which can be queried for event detailspublic void mouseReleased(PInputEvent event)
event
- object which can be queried for event detailspublic void mouseWheelRotated(PInputEvent event)
event
- an object that can be queries to discover the event's
detailspublic void mouseWheelRotatedByBlock(PInputEvent event)
event
- an object that can be queries to discover the event's
detailspublic void keyboardFocusGained(PInputEvent event)
event
- an object that can be queries to discover the event's
detailspublic void keyboardFocusLost(PInputEvent event)
event
- an object that can be queries to discover the event's
detailsCopyright © 1995-2013 Piccolo2D. All Rights Reserved.