public class GenericInput extends java.lang.Object implements IInput, KeyListener, MouseListener, MouseMotionListener, FocusListener
| Modifier and Type | Field and Description |
|---|---|
protected Point[] |
pointerDragInput |
protected Point |
pointerInput |
protected Point |
pointerMoveInput |
| Constructor and Description |
|---|
GenericInput() |
GenericInput(int keyCodeStart,
int keyCodeEnd,
int numButtons) |
| Modifier and Type | Method and Description |
|---|---|
void |
doMouseMove(MouseEvent e,
boolean drag) |
void |
focusGained(FocusEvent e) |
void |
focusLost(FocusEvent e) |
Point |
getPointer() |
Point |
getPointerDrag(int buttonIndex) |
Point |
getPointerMove() |
byte |
isButtonClicked(int index) |
float |
isButtonPressed(int index) |
boolean |
isButtonReleased(int index) |
byte |
isKeyClicked(int index) |
float |
isKeyPressed(int index) |
boolean |
isKeyReleased(int index) |
boolean |
isPointerLocked()
Optional
|
boolean |
keyPressed(KeyEvent e) |
boolean |
keyReleased(KeyEvent e) |
void |
lockPointer(Point pointerLockPosition)
Optional
|
boolean |
mouseClicked(MouseEvent e) |
boolean |
mouseDragged(MouseEvent e) |
void |
mouseEntered(MouseEvent e) |
void |
mouseExited(MouseEvent e) |
boolean |
mouseMoved(MouseEvent e) |
boolean |
mousePressed(MouseEvent e) |
boolean |
mouseReleased(MouseEvent e) |
void |
readInput()
Update (call it once per frame).
|
protected final Point pointerInput
protected final Point pointerMoveInput
protected final Point[] pointerDragInput
public GenericInput()
public GenericInput(int keyCodeStart,
int keyCodeEnd,
int numButtons)
keyCodeStart - key code (see KeyEvent) of the first character to record, suggested value: 0.keyCodeEnd - key code (see KeyEvent) of the last character to record, suggested value: 255.numButtons - number of buttons to record, suggested value: 3.KeyEventpublic void readInput()
IInputpublic void lockPointer(Point pointerLockPosition)
IInputlockPointer in interface IInputpublic boolean isPointerLocked()
IInputisPointerLocked in interface IInputIInput.lockPointer(Point)public final boolean mouseClicked(MouseEvent e)
mouseClicked in interface MouseListenere - the MouseEventpublic final boolean mousePressed(MouseEvent e)
mousePressed in interface MouseListenere - the MouseEventpublic final boolean mouseReleased(MouseEvent e)
mouseReleased in interface MouseListenere - the MouseEventpublic final void mouseEntered(MouseEvent e)
mouseEntered in interface MouseListenere - the MouseEventpublic final void mouseExited(MouseEvent e)
mouseExited in interface MouseListenere - the MouseEventpublic final boolean mouseDragged(MouseEvent e)
mouseDragged in interface MouseMotionListenere - the MouseEventpublic final boolean mouseMoved(MouseEvent e)
mouseMoved in interface MouseMotionListenere - the MouseEventpublic final void doMouseMove(MouseEvent e, boolean drag)
public final boolean keyPressed(KeyEvent e)
keyPressed in interface KeyListenere - the KeyEventpublic final boolean keyReleased(KeyEvent e)
keyReleased in interface KeyListenere - the KeyEventpublic final void focusGained(FocusEvent e)
focusGained in interface FocusListenerpublic final void focusLost(FocusEvent e)
focusLost in interface FocusListenerpublic Point getPointer()
getPointer in interface IInputpublic Point getPointerMove()
getPointerMove in interface IInputpublic Point getPointerDrag(int buttonIndex)
getPointerDrag in interface IInputpublic final float isKeyPressed(int index)
isKeyPressed in interface IInputindex - the key id (use KeyEvent.VK_)public final boolean isKeyReleased(int index)
isKeyReleased in interface IInputindex - the key id (use KeyEvent.VK_)public final byte isKeyClicked(int index)
isKeyClicked in interface IInputindex - the key id (use KeyEvent.VK_)public final float isButtonPressed(int index)
isButtonPressed in interface IInputindex - the button id, starting from 0public final boolean isButtonReleased(int index)
isButtonReleased in interface IInputindex - the button id, starting from 0public final byte isButtonClicked(int index)
isButtonClicked in interface IInputindex - the button id, starting from 0Bonzai Engine 1.4.1-20200831 - A Java OpenGL engine and tools for Windows/Mac/Linux/Android
Copyright © 2007-2019 Jérôme Jouvie bonzaiengine.com contact@bonzaiengine.com