Package com.jme3.input.lwjgl
Class GlfwJoystickInput
java.lang.Object
com.jme3.input.lwjgl.GlfwJoystickInput
The LWJGL implementation of
JoyInput.- Since:
- 3.1
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from interface com.jme3.input.JoyInput
AXIS_POV_X, AXIS_POV_Y -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddestroy()Ceases listening to events from the device.voidfireJoystickConnectedEvent(int jid) voidfireJoystickDisconnectedEvent(int jid) longvoidInitializes the native side to listen into events from the device.booleanJoystick[]loadJoysticks(InputManager inputManager) Loads a list of joysticks from the system.voidvoidsetInputListener(RawInputListener listener) Sets the input listener to receive events from this device.voidsetJoyRumble(int joyId, float amount) Causes the joystick atjoyIdindex to rumble with the given amount.voidupdate()Queries the device for input.
-
Constructor Details
-
GlfwJoystickInput
public GlfwJoystickInput()
-
-
Method Details
-
setJoyRumble
public void setJoyRumble(int joyId, float amount) Description copied from interface:JoyInputCauses the joystick atjoyIdindex to rumble with the given amount.- Specified by:
setJoyRumblein interfaceJoyInput- Parameters:
joyId- The joystick indexamount- Rumble amount. Should be between 0 and 1.
-
fireJoystickConnectedEvent
public void fireJoystickConnectedEvent(int jid) -
fireJoystickDisconnectedEvent
public void fireJoystickDisconnectedEvent(int jid) -
reloadJoysticks
public void reloadJoysticks() -
loadJoysticks
Description copied from interface:JoyInputLoads a list of joysticks from the system.- Specified by:
loadJoysticksin interfaceJoyInput- Parameters:
inputManager- The input manager requesting to load joysticks- Returns:
- A list of joysticks that are installed.
-
initialize
public void initialize()Description copied from interface:InputInitializes the native side to listen into events from the device.- Specified by:
initializein interfaceInput
-
update
public void update()Description copied from interface:InputQueries the device for input. All events should be sent to the RawInputListener set with setInputListener. -
destroy
public void destroy()Description copied from interface:InputCeases listening to events from the device. -
isInitialized
public boolean isInitialized()- Specified by:
isInitializedin interfaceInput- Returns:
- True if the device has been initialized and not destroyed.
- See Also:
-
setInputListener
Description copied from interface:InputSets the input listener to receive events from this device. The appropriate events should be dispatched through the callbacks in RawInputListener.- Specified by:
setInputListenerin interfaceInput- Parameters:
listener- the desired listener
-
getInputTimeNanos
public long getInputTimeNanos()- Specified by:
getInputTimeNanosin interfaceInput- Returns:
- The current absolute time as nanoseconds. This time is expected to be relative to the time given in InputEvents time property.
-