Top Description Inners Methods
net.java.games.input

public Interface Controller

Known Direct Implementers
net.java.games.input.AbstractController

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 and Inner Type Summary

Modifier and TypeClass and Description
public static class
Controller.PortType

Common controller port types.

public static class
Controller.Type

Types of controller objects.

Method Summary

Modifier and TypeMethod and Description
public 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.

public Component[]
getComponents()

Returns the components on this controller, in order of assignment priority.

public Controller[]
getControllers()

Returns the controllers connected to make up this controller, or an empty array if this controller contains no child controllers.

public EventQueue
getEventQueue()

Get the device event queue

public String
getName()

Returns a human-readable name for this Controller.

public int
getPortNumber()

Returns the zero-based port number for this Controller.

public Controller.PortType
getPortType()

Returns the port type for this Controller.

public Rumbler[]
getRumblers()

Returns the rumblers for sending feedback to this controller, or an empty array if there are no rumblers on this controller.

public Controller.Type
getType()

Returns the type of the Controller.

public boolean
poll()

Polls axes for data.

public void
setEventQueueSize(int size)

Initialized the controller event queue to a new size.

Method Detail

getComponentback to summary
public 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.

getComponentsback to summary
public 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).

getControllersback to summary
public 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.).

getEventQueueback to summary
public EventQueue getEventQueue()

Get the device event queue

getNameback to summary
public String getName()

Returns a human-readable name for this Controller.

getPortNumberback to summary
public int getPortNumber()

Returns the zero-based port number for this Controller.

getPortTypeback to summary
public Controller.PortType getPortType()

Returns the port type for this Controller.

getRumblersback to summary
public Rumbler[] getRumblers()

Returns the rumblers for sending feedback to this controller, or an empty array if there are no rumblers on this controller.

getTypeback to summary
public Controller.Type getType()

Returns the type of the Controller.

pollback to summary
public 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.

setEventQueueSizeback to summary
public void setEventQueueSize(int size)

Initialized the controller event queue to a new size. Existing events in the queue are lost.

net.java.games.input back to summary

public final Class Controller.PortType

extends Object
Class Inheritance

Common controller port types.

Field Summary

Modifier and TypeField and Description
public static final Controller.PortType
GAME

Standard game port

public static final Controller.PortType
I8042

i8042

private final String
name

Name of port type

public static final Controller.PortType
NETWORK

Network port

public static final Controller.PortType
PARALLEL

Parallel port

public static final Controller.PortType
SERIAL

Serial port

public static final Controller.PortType
UNKNOWN

Unknown port type

public static final Controller.PortType
USB

USB port

Constructor Summary

AccessConstructor and Description
protected
PortType(String name)

Protected constructor

Method Summary

Modifier and TypeMethod and Description
public String
toString()

Overrides java.lang.Object.toString.

Returns a non-localized string description of this port type.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

GAMEback to summary
public static final Controller.PortType GAME

Standard game port

I8042back to summary
public static final Controller.PortType I8042

i8042

nameback to summary
private final String name

Name of port type

NETWORKback to summary
public static final Controller.PortType NETWORK

Network port

PARALLELback to summary
public static final Controller.PortType PARALLEL

Parallel port

SERIALback to summary
public static final Controller.PortType SERIAL

Serial port

UNKNOWNback to summary
public static final Controller.PortType UNKNOWN

Unknown port type

USBback to summary
public static final Controller.PortType USB

USB port

Constructor Detail

PortTypeback to summary
protected PortType(String name)

Protected constructor

Method Detail

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Returns a non-localized string description of this port type.

Returns:String

Doc from java.lang.Object.toString.

a string representation of the object

net.java.games.input back to summary

public Class Controller.Type

extends Object
Class Inheritance

Types of controller objects.

Field Summary

Modifier and TypeField and Description
public static final Controller.Type
FINGERSTICK

Fingerstick controller; note that this may be sometimes treated as a type of mouse or stick.

public static final Controller.Type
GAMEPAD

Gamepad controller.

public static final Controller.Type
HEADTRACKER

Headtracker controller.

public static final Controller.Type
KEYBOARD

A keyboard controller

public static final Controller.Type
MOUSE

Mouse controller.

private final String
name

Name of controller type

public static final Controller.Type
RUDDER

Rudder controller.

public static final Controller.Type
STICK

Stick controller, such as a joystick or flightstick.

public static final Controller.Type
TRACKBALL

A trackball controller; note that this may sometimes be treated as a type of mouse.

public static final Controller.Type
TRACKPAD

A trackpad, such as a tablet, touchpad, or glidepad; note that this may sometimes be treated as a type of mouse.

public static final Controller.Type
UNKNOWN

Unkown controller type.

public static final Controller.Type
WHEEL

A wheel controller, such as a steering wheel (note that a mouse wheel is considered part of a mouse, not a wheel controller).

Constructor Summary

AccessConstructor and Description
protected
Type(String name)

Protected constructor

Method Summary

Modifier and TypeMethod and Description
public String
toString()

Overrides java.lang.Object.toString.

Returns a non-localized string description of this controller type.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

FINGERSTICKback to summary
public static final Controller.Type FINGERSTICK

Fingerstick controller; note that this may be sometimes treated as a type of mouse or stick.

GAMEPADback to summary
public static final Controller.Type GAMEPAD

Gamepad controller.

HEADTRACKERback to summary
public static final Controller.Type HEADTRACKER

Headtracker controller.

KEYBOARDback to summary
public static final Controller.Type KEYBOARD

A keyboard controller

MOUSEback to summary
public static final Controller.Type MOUSE

Mouse controller.

nameback to summary
private final String name

Name of controller type

RUDDERback to summary
public static final Controller.Type RUDDER

Rudder controller.

STICKback to summary
public static final Controller.Type STICK

Stick controller, such as a joystick or flightstick.

TRACKBALLback to summary
public static final Controller.Type TRACKBALL

A trackball controller; note that this may sometimes be treated as a type of mouse.

TRACKPADback to summary
public static final Controller.Type TRACKPAD

A trackpad, such as a tablet, touchpad, or glidepad; note that this may sometimes be treated as a type of mouse.

UNKNOWNback to summary
public static final Controller.Type UNKNOWN

Unkown controller type.

WHEELback to summary
public static final Controller.Type WHEEL

A wheel controller, such as a steering wheel (note that a mouse wheel is considered part of a mouse, not a wheel controller).

Constructor Detail

Typeback to summary
protected Type(String name)

Protected constructor

Method Detail

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Returns a non-localized string description of this controller type.

Returns:String

Doc from java.lang.Object.toString.

a string representation of the object