org.newdawn.slick.util
Class InputAdapter

java.lang.Object
  extended by org.newdawn.slick.util.InputAdapter
All Implemented Interfaces:
ControlledInputReciever, ControllerListener, InputListener, KeyListener, MouseListener
Direct Known Subclasses:
AbstractComponent

public class InputAdapter
extends java.lang.Object
implements InputListener

An implement implementation of the InputListener interface

Author:
kevin

Constructor Summary
InputAdapter()
           
 
Method Summary
 void controllerButtonPressed(int controller, int button)
          Notification that a button control has been pressed on the controller.
 void controllerButtonReleased(int controller, int button)
          Notification that a button control has been released on the controller.
 void controllerDownPressed(int controller)
          Notification that the down control has been pressed on the controller.
 void controllerDownReleased(int controller)
          Notification that the down control has been released on the controller.
 void controllerLeftPressed(int controller)
          Notification that the left control has been pressed on the controller.
 void controllerLeftReleased(int controller)
          Notification that the left control has been released on the controller.
 void controllerRightPressed(int controller)
          Notification that the right control has been pressed on the controller.
 void controllerRightReleased(int controller)
          Notification that the right control has been released on the controller.
 void controllerUpPressed(int controller)
          Notification that the up control has been pressed on the controller.
 void controllerUpReleased(int controller)
          Notification that the up control has been released on the controller.
 void inputEnded()
          Notification that all input events have been sent for this frame
 void inputStarted()
          Notification that input is about to be processed
 boolean isAcceptingInput()
          Check if this input listener is accepting input
 void keyPressed(int key, char c)
          Notification that a key was pressed
 void keyReleased(int key, char c)
          Notification that a key was released
 void mouseClicked(int button, int x, int y, int clickCount)
          Notification that a mouse button was clicked.
 void mouseDragged(int oldx, int oldy, int newx, int newy)
          Notification that mouse cursor was dragged
 void mouseMoved(int oldx, int oldy, int newx, int newy)
          Notification that mouse cursor was moved
 void mousePressed(int button, int x, int y)
          Notification that a mouse button was pressed
 void mouseReleased(int button, int x, int y)
          Notification that a mouse button was released
 void mouseWheelMoved(int change)
          Notification that the mouse wheel position was updated
 void setAcceptingInput(boolean acceptingInput)
          Indicate if we should be accepting input of any sort
 void setInput(Input input)
          Set the input that events are being sent from
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InputAdapter

public InputAdapter()
Method Detail

controllerButtonPressed

public void controllerButtonPressed(int controller,
                                    int button)
Description copied from interface: ControllerListener
Notification that a button control has been pressed on the controller.

Specified by:
controllerButtonPressed in interface ControllerListener
Parameters:
controller - The index of the controller on which the control was pressed.
button - The index of the button pressed (starting at 1)
See Also:
ControllerListener.controllerButtonPressed(int, int)

controllerButtonReleased

public void controllerButtonReleased(int controller,
                                     int button)
Description copied from interface: ControllerListener
Notification that a button control has been released on the controller.

Specified by:
controllerButtonReleased in interface ControllerListener
Parameters:
controller - The index of the controller on which the control was released.
button - The index of the button released (starting at 1)
See Also:
ControllerListener.controllerButtonReleased(int, int)

controllerDownPressed

public void controllerDownPressed(int controller)
Description copied from interface: ControllerListener
Notification that the down control has been pressed on the controller.

Specified by:
controllerDownPressed in interface ControllerListener
Parameters:
controller - The index of the controller on which the control was pressed.
See Also:
ControllerListener.controllerDownPressed(int)

controllerDownReleased

public void controllerDownReleased(int controller)
Description copied from interface: ControllerListener
Notification that the down control has been released on the controller.

Specified by:
controllerDownReleased in interface ControllerListener
Parameters:
controller - The index of the controller on which the control was released.
See Also:
ControllerListener.controllerDownReleased(int)

controllerLeftPressed

public void controllerLeftPressed(int controller)
Description copied from interface: ControllerListener
Notification that the left control has been pressed on the controller.

Specified by:
controllerLeftPressed in interface ControllerListener
Parameters:
controller - The index of the controller on which the control was pressed.
See Also:
ControllerListener.controllerLeftPressed(int)

controllerLeftReleased

public void controllerLeftReleased(int controller)
Description copied from interface: ControllerListener
Notification that the left control has been released on the controller.

Specified by:
controllerLeftReleased in interface ControllerListener
Parameters:
controller - The index of the controller on which the control was released.
See Also:
ControllerListener.controllerLeftReleased(int)

controllerRightPressed

public void controllerRightPressed(int controller)
Description copied from interface: ControllerListener
Notification that the right control has been pressed on the controller.

Specified by:
controllerRightPressed in interface ControllerListener
Parameters:
controller - The index of the controller on which the control was pressed.
See Also:
ControllerListener.controllerRightPressed(int)

controllerRightReleased

public void controllerRightReleased(int controller)
Description copied from interface: ControllerListener
Notification that the right control has been released on the controller.

Specified by:
controllerRightReleased in interface ControllerListener
Parameters:
controller - The index of the controller on which the control was released.
See Also:
ControllerListener.controllerRightReleased(int)

controllerUpPressed

public void controllerUpPressed(int controller)
Description copied from interface: ControllerListener
Notification that the up control has been pressed on the controller.

Specified by:
controllerUpPressed in interface ControllerListener
Parameters:
controller - The index of the controller on which the control was pressed.
See Also:
ControllerListener.controllerUpPressed(int)

controllerUpReleased

public void controllerUpReleased(int controller)
Description copied from interface: ControllerListener
Notification that the up control has been released on the controller.

Specified by:
controllerUpReleased in interface ControllerListener
Parameters:
controller - The index of the controller on which the control was released.
See Also:
ControllerListener.controllerUpReleased(int)

inputEnded

public void inputEnded()
Description copied from interface: ControlledInputReciever
Notification that all input events have been sent for this frame

Specified by:
inputEnded in interface ControlledInputReciever
See Also:
ControlledInputReciever.inputEnded()

isAcceptingInput

public boolean isAcceptingInput()
Description copied from interface: ControlledInputReciever
Check if this input listener is accepting input

Specified by:
isAcceptingInput in interface ControlledInputReciever
Returns:
True if the input listener should recieve events
See Also:
ControlledInputReciever.isAcceptingInput()

setAcceptingInput

public void setAcceptingInput(boolean acceptingInput)
Indicate if we should be accepting input of any sort

Parameters:
acceptingInput - True if we should accept input

keyPressed

public void keyPressed(int key,
                       char c)
Description copied from interface: KeyListener
Notification that a key was pressed

Specified by:
keyPressed in interface KeyListener
Parameters:
key - The key code that was pressed (@see org.newdawn.slick.Input)
c - The character of the key that was pressed
See Also:
KeyListener.keyPressed(int, char)

keyReleased

public void keyReleased(int key,
                        char c)
Description copied from interface: KeyListener
Notification that a key was released

Specified by:
keyReleased in interface KeyListener
Parameters:
key - The key code that was released (@see org.newdawn.slick.Input)
c - The character of the key that was released
See Also:
KeyListener.keyReleased(int, char)

mouseMoved

public void mouseMoved(int oldx,
                       int oldy,
                       int newx,
                       int newy)
Description copied from interface: MouseListener
Notification that mouse cursor was moved

Specified by:
mouseMoved in interface MouseListener
Parameters:
oldx - The old x position of the mouse
oldy - The old y position of the mouse
newx - The new x position of the mouse
newy - The new y position of the mouse
See Also:
MouseListener.mouseMoved(int, int, int, int)

mousePressed

public void mousePressed(int button,
                         int x,
                         int y)
Description copied from interface: MouseListener
Notification that a mouse button was pressed

Specified by:
mousePressed in interface MouseListener
Parameters:
button - The index of the button (starting at 0)
x - The x position of the mouse when the button was pressed
y - The y position of the mouse when the button was pressed
See Also:
MouseListener.mousePressed(int, int, int)

mouseReleased

public void mouseReleased(int button,
                          int x,
                          int y)
Description copied from interface: MouseListener
Notification that a mouse button was released

Specified by:
mouseReleased in interface MouseListener
Parameters:
button - The index of the button (starting at 0)
x - The x position of the mouse when the button was released
y - The y position of the mouse when the button was released
See Also:
MouseListener.mouseReleased(int, int, int)

mouseWheelMoved

public void mouseWheelMoved(int change)
Description copied from interface: MouseListener
Notification that the mouse wheel position was updated

Specified by:
mouseWheelMoved in interface MouseListener
Parameters:
change - The amount of the wheel has moved
See Also:
MouseListener.mouseWheelMoved(int)

setInput

public void setInput(Input input)
Description copied from interface: ControlledInputReciever
Set the input that events are being sent from

Specified by:
setInput in interface ControlledInputReciever
Parameters:
input - The input instance sending events
See Also:
ControlledInputReciever.setInput(org.newdawn.slick.Input)

mouseClicked

public void mouseClicked(int button,
                         int x,
                         int y,
                         int clickCount)
Description copied from interface: MouseListener
Notification that a mouse button was clicked. Due to double click handling the single click may be delayed slightly. For absolute notification of single clicks use mousePressed(). To be absolute this method should only be used when considering double clicks

Specified by:
mouseClicked in interface MouseListener
Parameters:
button - The index of the button (starting at 0)
x - The x position of the mouse when the button was pressed
y - The y position of the mouse when the button was pressed
clickCount - The number of times the button was clicked
See Also:
MouseListener.mouseClicked(int, int, int, int)

mouseDragged

public void mouseDragged(int oldx,
                         int oldy,
                         int newx,
                         int newy)
Description copied from interface: MouseListener
Notification that mouse cursor was dragged

Specified by:
mouseDragged in interface MouseListener
Parameters:
oldx - The old x position of the mouse
oldy - The old y position of the mouse
newx - The new x position of the mouse
newy - The new y position of the mouse

inputStarted

public void inputStarted()
Description copied from interface: ControlledInputReciever
Notification that input is about to be processed

Specified by:
inputStarted in interface ControlledInputReciever
See Also:
ControlledInputReciever.inputStarted()


Copyright © 2006 New Dawn Software. All Rights Reserved.