Xj3D 2.0 VRML/X3D Code API

org.xj3d.ui.awt.device.keyboard
Class KeyboardDevice

java.lang.Object
  extended by org.xj3d.ui.awt.device.keyboard.KeyboardDevice
All Implemented Interfaces:
java.awt.event.KeyListener, java.util.EventListener, ControllerDevice, InputDevice, TrackerDevice

public class KeyboardDevice
extends java.lang.Object
implements TrackerDevice, java.awt.event.KeyListener

A keyboard device. This device is a navigation only device.

Version:
$Revision: 1.2 $
Author:
Alan Hudson

Field Summary
 
Fields inherited from interface org.xj3d.device.InputDevice
FUNC_BUTTON_1, FUNC_BUTTON_2, FUNC_BUTTON_3, FUNC_BUTTON_4, FUNC_L1_BUTTON, FUNC_LEFT_HAT, FUNC_LEFT_STICK_X, FUNC_LEFT_STICK_Y, FUNC_LEFT_STICK_Z, FUNC_NAV_X, FUNC_NAV_Y, FUNC_NAV_Y_CENTERED, FUNC_NONE, FUNC_ORIENT_X, FUNC_ORIENT_Y, FUNC_R1_BUTTON, FUNC_RIGHT_STICK_X, FUNC_RIGHT_STICK_Y, FUNC_START_BUTTON, FUNC_THROTTLE, FUNC_VIEWPOINT_NEXT, FUNC_WHEEL_X
 
Constructor Summary
KeyboardDevice(java.lang.String name)
           
 
Method Summary
 java.lang.String getName()
          Get the name of this device.
 int getTrackerCount()
          Get a count of the number of trackers this device has.
 Tracker[] getTrackers()
          Get the trackers of this device.
 void keyPressed(java.awt.event.KeyEvent evt)
          Notification of a key press event.
 void keyReleased(java.awt.event.KeyEvent evt)
          Notification of a key release event.
 void keyTyped(java.awt.event.KeyEvent evt)
          Notification of a key type (press and release) event.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

KeyboardDevice

public KeyboardDevice(java.lang.String name)
Method Detail

getName

public java.lang.String getName()
Get the name of this device. Names are of the form class-#. Valid classes are Gamepad, Joystick, Wheel, Midi, GenericHID.

Specified by:
getName in interface InputDevice
Returns:
The name

getTrackers

public Tracker[] getTrackers()
Description copied from interface: TrackerDevice
Get the trackers of this device.

Specified by:
getTrackers in interface TrackerDevice
Returns:
The trackers. This cannot changed after startup.

getTrackerCount

public int getTrackerCount()
Get a count of the number of trackers this device has. This cannot change during the life of a device.

Specified by:
getTrackerCount in interface TrackerDevice
Returns:
The number of trackers. This cannot change after startup.

keyPressed

public void keyPressed(java.awt.event.KeyEvent evt)
Notification of a key press event. This will any one of the key value fields depending on the value.

Specified by:
keyPressed in interface java.awt.event.KeyListener
Parameters:
evt - The key event that caused this method to be called

keyReleased

public void keyReleased(java.awt.event.KeyEvent evt)
Notification of a key release event. This will any one of the key value fields depending on the value.

Specified by:
keyReleased in interface java.awt.event.KeyListener
Parameters:
evt - The key event that caused this method to be called

keyTyped

public void keyTyped(java.awt.event.KeyEvent evt)
Notification of a key type (press and release) event. This will any one of the key value fields depending on the value.

Specified by:
keyTyped in interface java.awt.event.KeyListener
Parameters:
evt - The key event that caused this method to be called

Xj3D 2.0 VRML/X3D Code API

Copyright © 2001 - 2006 Web3D Consortium