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
Nested Classes Modifier and Type Interface Description static class
Controller.PortType
Common controller port types.static class
Controller.Type
Types of controller objects.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Component
getComponent(Component.Identifier id)
Returns a single axis based on its type, or null if no axis with the specified type could be found.Component[]
getComponents()
Returns the components on this controller, in order of assignment priority.Controller[]
getControllers()
Returns the controllers connected to make up this controller, or an empty array if this controller contains no child controllers.EventQueue
getEventQueue()
Get the device event queuejava.lang.String
getName()
Returns a human-readable name for this Controller.int
getPortNumber()
Returns the zero-based port number for this Controller.Controller.PortType
getPortType()
Returns the port type for this Controller.Rumbler[]
getRumblers()
Returns the rumblers for sending feedback to this controller, or an empty array if there are no rumblers on this controller.Controller.Type
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 Detail
-
getControllers
Controller[] 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
Component getComponent(Component.Identifier id)
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
java.lang.String getName()
Returns a human-readable name for this Controller.
-
-