Package net.java.games.input
Interface Controller
- All Known Implementing Classes:
AbstractController
,Keyboard
,LinuxCombinedController
,Mouse
,WinTabDevice
public interface Controller
A Controller represents a physical device, such as a keyboard, mouse,
or joystick, or a logical grouping of related controls, such as a button
pad or mouse ball. A controller can be composed of multiple controllers.
For example, the ball of a mouse and its buttons are two separate
controllers.
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic final class
Common controller port types.static class
Types of controller objects. -
Method Summary
Modifier and TypeMethodDescriptionReturns a single axis based on its type, or null if no axis with the specified type could be found.Returns the components on this controller, in order of assignment priority.Returns the controllers connected to make up this controller, or an empty array if this controller contains no child controllers.Get the device event queuegetName()
Returns a human-readable name for this Controller.int
Returns the zero-based port number for this Controller.Returns the port type for this Controller.Rumbler[]
Returns the rumblers for sending feedback to this controller, or an empty array if there are no rumblers on this controller.getType()
Returns the type of the Controller.boolean
poll()
Polls axes for data.void
setEventQueueSize
(int size) Initialized the controller event queue to a new size.
-
Method Details
-
getControllers
AbstractController[] getControllers()Returns the controllers connected to make up this controller, or an empty array if this controller contains no child controllers. The objects in the array are returned in order of assignment priority (primary stick, secondary buttons, etc.). -
getType
Controller.Type getType()Returns the type of the Controller. -
getComponents
Component[] getComponents()Returns the components on this controller, in order of assignment priority. For example, the button controller on a mouse returns an array containing the primary or leftmost mouse button, followed by the secondary or rightmost mouse button (if present), followed by the middle mouse button (if present). The array returned is an empty array if this controller contains no components (such as a logical grouping of child controllers). -
getComponent
Returns a single axis based on its type, or null if no axis with the specified type could be found. -
getRumblers
Rumbler[] getRumblers()Returns the rumblers for sending feedback to this controller, or an empty array if there are no rumblers on this controller. -
poll
boolean poll()Polls axes for data. Returns false if the controller is no longer valid. Polling reflects the current state of the device when polled. -
setEventQueueSize
void setEventQueueSize(int size) Initialized the controller event queue to a new size. Existing events in the queue are lost. -
getEventQueue
EventQueue getEventQueue()Get the device event queue -
getPortType
Controller.PortType getPortType()Returns the port type for this Controller. -
getPortNumber
int getPortNumber()Returns the zero-based port number for this Controller. -
getName
String getName()Returns a human-readable name for this Controller.
-