Package com.openinventor.inventor.events
Class SoKeyboardEvent
- java.lang.Object
 - 
- com.openinventor.inventor.Inventor
 - 
- com.openinventor.inventor.events.SoEvent
 - 
- com.openinventor.inventor.events.SoButtonEvent
 - 
- com.openinventor.inventor.events.SoKeyboardEvent
 
 
 
 
 
- 
public class SoKeyboardEvent extends SoButtonEvent
Keyboard key press and release events.SoKeyboardEventrepresents keyboard key press and release events in the Open Inventor event model.Add an
SoEventCallbacknode to the scene graph to handle Open Inventor events.- See Also:
 SoEvent,SoButtonEvent,SoLocation2Event,SoMotion3Event,SoMouseButtonEvent,SoSpaceballButtonEvent,SoHandleEventAction,SoEventCallback,SoSelection SoInteraction,SoWinDevice
 
- 
- 
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSoKeyboardEvent.KeysThe keyboard keys.- 
Nested classes/interfaces inherited from class com.openinventor.inventor.events.SoButtonEvent
SoButtonEvent.States 
- 
Nested classes/interfaces inherited from class com.openinventor.inventor.Inventor
Inventor.ConstructorCommand 
 - 
 
- 
Field Summary
- 
Fields inherited from class com.openinventor.inventor.Inventor
VERBOSE_LEVEL, ZeroHandle 
 - 
 
- 
Constructor Summary
Constructors Constructor Description SoKeyboardEvent()Constructor. 
- 
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description SoKeyboardEvent.KeysgetKey()Gets which key generated the event.static SoKeyboardEvent.KeysgetKeySym(int key)bytegetPrintableCharacter()Convenience routine that returns the character representing the key, if it's printable.static booleanisKeyPressEvent(SoEvent e, SoKeyboardEvent.Keys whichKey)Returns whether the passed event is a keyboard press event of the passed key.static booleanisKeyReleaseEvent(SoEvent e, SoKeyboardEvent.Keys whichKey)Returns whether the passed event is a keyboard release event of the passed key.voidsetKey(SoKeyboardEvent.Keys whichKey)Sets which key generated the event.- 
Methods inherited from class com.openinventor.inventor.events.SoButtonEvent
getState, setState 
- 
Methods inherited from class com.openinventor.inventor.events.SoEvent
getNormalizedPosition, getPosition, getPosition, getPositionFloat, getPositionFloat, getTime, setAltDown, setButton1Down, setCtrlDown, setPosition, setPosition, setShiftDown, setTime, wasAltDown, wasButton1Down, wasCtrlDown, wasShiftDown 
- 
Methods inherited from class com.openinventor.inventor.Inventor
dispose, getNativeResourceHandle 
 - 
 
 - 
 
- 
- 
Method Detail
- 
getKeySym
public static SoKeyboardEvent.Keys getKeySym(int key)
 
- 
setKey
public void setKey(SoKeyboardEvent.Keys whichKey)
Sets which key generated the event. 
- 
isKeyPressEvent
public static boolean isKeyPressEvent(SoEvent e, SoKeyboardEvent.Keys whichKey)
Returns whether the passed event is a keyboard press event of the passed key. WhenSoKeyboardEvent.ANYis passed, this returns true if the event represents a keyboard press of any key. 
- 
getKey
public SoKeyboardEvent.Keys getKey()
Gets which key generated the event. 
- 
isKeyReleaseEvent
public static boolean isKeyReleaseEvent(SoEvent e, SoKeyboardEvent.Keys whichKey)
Returns whether the passed event is a keyboard release event of the passed key. WhenSoKeyboardEvent.ANYis passed, this returns true if the event represents a keyboard release of any key. 
- 
getPrintableCharacter
public byte getPrintableCharacter()
Convenience routine that returns the character representing the key, if it's printable. If not, this returns NULL ('\0'). 
 - 
 
 -