Package net.java.games.input
Class Keyboard
- java.lang.Object
-
- net.java.games.input.AbstractController
-
- net.java.games.input.Keyboard
-
- All Implemented Interfaces:
Controller
public abstract class Keyboard extends AbstractController
A Keyboard is a type of controller consisting of a single controller, they keypad, which contains several axes (the keys). By default, all keys are set to receive polling data.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface net.java.games.input.Controller
Controller.PortType, Controller.Type
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
Keyboard(java.lang.String name, Component[] keys, Controller[] children, Rumbler[] rumblers)
Protected constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Controller.Type
getType()
Returns the type of the Controller.boolean
isKeyDown(Component.Identifier.Key key_id)
-
Methods inherited from class net.java.games.input.AbstractController
getComponent, getComponents, getControllers, getEventQueue, getName, getNextDeviceEvent, getPortNumber, getPortType, getRumblers, poll, pollDevice, setDeviceEventQueueSize, setEventQueueSize, toString
-
-
-
-
Constructor Detail
-
Keyboard
protected Keyboard(java.lang.String name, Component[] keys, Controller[] children, Rumbler[] rumblers)
Protected constructor. Subclasses should initialize the array of axes to an array of keys.- Parameters:
name
- The name of the keyboard
-
-
Method Detail
-
getType
public Controller.Type getType()
Returns the type of the Controller.- Specified by:
getType
in interfaceController
- Overrides:
getType
in classAbstractController
-
isKeyDown
public final boolean isKeyDown(Component.Identifier.Key key_id)
-
-