You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
50 lines
1.2 KiB
50 lines
1.2 KiB
package net.sector.input;
|
|
|
|
|
|
import com.porcupine.coord.Coord;
|
|
import com.porcupine.coord.Vec;
|
|
|
|
|
|
/**
|
|
* Input event handler
|
|
*
|
|
* @author Ondřej Hruška (MightyPork)
|
|
*/
|
|
public interface IInputHandler {
|
|
/**
|
|
* Called each update tick, if the mouse position was changed.
|
|
*
|
|
* @param pos mouse position
|
|
* @param move mouse motion
|
|
* @param wheelDelta mouse wheel delta
|
|
*/
|
|
public void onMouseMove(Coord pos, Vec move, int wheelDelta);
|
|
|
|
/**
|
|
* Mouse event handler.
|
|
*
|
|
* @param button button which caused this event
|
|
* @param down true = down, false = up
|
|
* @param wheelDelta number of steps the wheel turned since last event
|
|
* @param pos mouse position
|
|
* @param deltaPos delta mouse position
|
|
*/
|
|
public void onMouseButton(int button, boolean down, int wheelDelta, Coord pos, Coord deltaPos);
|
|
|
|
|
|
/**
|
|
* Key event handler.
|
|
*
|
|
* @param key key index, constant Keyboard.KEY_???
|
|
* @param c character typed, if any
|
|
* @param down true = down, false = up
|
|
*/
|
|
public void onKey(int key, char c, boolean down);
|
|
|
|
|
|
/**
|
|
* In this method screen can handle static inputs, that is:
|
|
* Keyboard.isKeyDown, Mouse.isButtonDown etc.
|
|
*/
|
|
public void handleStaticInputs();
|
|
}
|
|
|