public interface IInputHandler
IGameInstance.getInput().IGameInstance.getInput(),
RockBottomAPI.getGame()| Modifier and Type | Method and Description |
|---|---|
void |
allowKeyboardEvents(boolean allow)
A setter for wether keyboard repeat events should be allowed.
|
int |
getHorizontalMouseWheelChange()
Returns the amount of delta that the mouse wheel has been shifted
horizontally since the last tick.
|
int |
getMouseWheelChange()
Returns the amount of delta that the mouse wheel has been turned since
the last tick.
|
int |
getMouseX()
Gets the mouse's current x coordinate on screen.
|
int |
getMouseY()
Gets the mouse's current y coordinate on screen
|
boolean |
isKeyDown(int key)
Return true if the given key is currently being held down
|
boolean |
isMouseDown(int button)
Returns true if the given mouse button is currently being held down
|
boolean |
isMouseInWindow()
Returns true if the mouse cursor is currently inside of the window.
|
boolean |
wasKeyPressed(int key)
Returns true if a keyboard key was singly pressed inbetween the last tick
and this one.
|
boolean |
wasKeyPressedWithinTime(int key,
int amount,
long time)
Returns true if a keyboard key was pressed the amount of times within the specified time.
|
boolean |
wasMousePressed(int button)
Returns true if the mouse was singly pressed inbetween the last tick and
this one.
|
boolean isMouseInWindow()
boolean isMouseDown(int button)
button - The button to query. Use the GLFW class to easily
get mouse buttons' idswasMousePressed(int)boolean wasMousePressed(int button)
button - The button toe query. Use the GLFW class to easily
get mouse buttons' idsisMouseDown(int)boolean isKeyDown(int key)
key - The key to query. Use the GLFW class to easily get
keys' idswasKeyPressed(int)boolean wasKeyPressed(int key)
key - The key to query. Use the GLFW class to easily get
keys' idsisKeyDown(int)boolean wasKeyPressedWithinTime(int key,
int amount,
long time)
key - The key to query. Use the GLFW class to easily get keys' idsamount - The amount of times the key needs to be pressedtime - In which time the presses need to occur in millisecondsint getMouseWheelChange()
getHorizontalMouseWheelChange()int getHorizontalMouseWheelChange()
getMouseWheelChange()int getMouseX()
IRenderer.getMouseInGuiX(),
IRenderer.getMousedTileX()int getMouseY()
IRenderer.getMouseInGuiY(),
IRenderer.getMousedTileY()void allowKeyboardEvents(boolean allow)
wasKeyPressed(int) will be triggered again after a short while. This is
automatically enabled in Guis and can be useful for when you want to,
say, remove a big amount of text by just holding down the backspace key.
Note that this method should actually be called "allowKeyboardRepeats". Oh well.
allow - If repeated keyboard events should be allowed