|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jmex.editors.swing.controls.ControlFieldListener
public class ControlFieldListener
Constructor Summary | |
---|---|
ControlFieldListener(GameControlEditor editor)
|
Method Summary | |
---|---|
void |
onAxis(Joystick controller,
int axis,
float axisValue)
Invoked when an axis has changed it's value. |
void |
onButton(int button,
boolean pressed,
int x,
int y)
Called in KeyInput.update() whenever a mouse button is pressed or released. |
void |
onButton(Joystick controller,
int button,
boolean pressed)
Invoked when a button was pressed or released. |
void |
onKey(char character,
int keyCode,
boolean pressed)
Called in KeyInput.update() whenever a key is pressed or released. |
void |
onMove(int xDelta,
int yDelta,
int newX,
int newY)
Called in KeyInput.update() whenever the mouse is moved. |
void |
onWheel(int wheelDelta,
int x,
int y)
Called in KeyInput.update() whenever the mouse wheel is rotated. |
void |
prompt(ControlField field)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ControlFieldListener(GameControlEditor editor)
Method Detail |
---|
public void prompt(ControlField field)
public void onKey(char character, int keyCode, boolean pressed)
KeyInputListener
KeyInput.update()
whenever a key is pressed or released.
onKey
in interface KeyInputListener
character
- character associated with pressed key, 0 if not applicable (e.g. if key released)keyCode
- key code of the pressed/released keypressed
- true if key was pressed, false if releasedpublic void onButton(int button, boolean pressed, int x, int y)
MouseInputListener
KeyInput.update()
whenever a mouse button is pressed or released.
onButton
in interface MouseInputListener
button
- index of the mouse button that was pressed/releasedpressed
- true if button was pressed, false if releasedx
- x position of the mouse while button was pressed/releasedy
- y position of the mouse while button was pressed/releasedpublic void onMove(int xDelta, int yDelta, int newX, int newY)
MouseInputListener
KeyInput.update()
whenever the mouse is moved.
onMove
in interface MouseInputListener
xDelta
- delta of the x coordinate since the last mouse movement eventyDelta
- delta of the y coordinate since the last mouse movement eventnewX
- x position of the mouse after the mouse was movednewY
- y position of the mouse after the mouse was movedpublic void onWheel(int wheelDelta, int x, int y)
MouseInputListener
KeyInput.update()
whenever the mouse wheel is rotated.
onWheel
in interface MouseInputListener
wheelDelta
- steps the wheel was rotatedx
- x position of the mouse while wheel was rotatedy
- y position of the mouse while wheel was rotatedpublic void onAxis(Joystick controller, int axis, float axisValue)
JoystickInputListener
onAxis
in interface JoystickInputListener
controller
- joystick the axis belongs toaxis
- index of the axisaxisValue
- new value of the axispublic void onButton(Joystick controller, int button, boolean pressed)
JoystickInputListener
onButton
in interface JoystickInputListener
controller
- joystick the button belongs tobutton
- index of the buttonpressed
- true if button was pressed, false if released
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |