Interface KeySensor
- All Superinterfaces:
X3DChildNode,X3DKeyDeviceSensorNode,X3DNode,X3DSensorNode
- All Known Implementing Classes:
KeySensor
KeySensor generates events as the user presses keys on the keyboard.
KeySensor node tooltip: [X3DKeyDeviceSensorNode] KeySensor generates events as the user presses keys on the keyboard. Browser support includes the notion of "keyboard focus".
Package hint: This interface is defined by the X3D Java Language Binding Specification for the Scene Authoring Interface (SAI).
KeySensor node tooltip: [X3DKeyDeviceSensorNode] KeySensor generates events as the user presses keys on the keyboard. Browser support includes the notion of "keyboard focus".
- Hint: example scenes and authoring assets at https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter08UserInteractivity
Package hint: This interface is defined by the X3D Java Language Binding Specification for the Scene Authoring Interface (SAI).
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionintProvide int value from outputOnly SFInt32 field named actionKeyPress.intProvide int value from outputOnly SFInt32 field named actionKeyRelease.booleanProvide boolean value from outputOnly SFBool field named altKey.booleanProvide boolean value from outputOnly SFBool field named controlKey.Provide String value from inputOutput SFString field named description.booleanProvide boolean value from inputOutput SFBool field named enabled.booleanProvide boolean value from outputOnly SFBool field named isActive.Provide String value from outputOnly SFString field named keyPress.Provide String value from outputOnly SFString field named keyRelease.Provide org.web3d.x3d.sai.Core.X3DMetadataObject instance (using a properly typed node) from inputOutput SFNode field metadata.booleanProvide boolean value from outputOnly SFBool field named shiftKey.setDescription(String newValue) Accessor method to assign String value to inputOutput SFString field named description.setEnabled(boolean newValue) Accessor method to assign boolean value to inputOutput SFBool field named enabled.setMetadata(X3DMetadataObject newValue) Accessor method to assign org.web3d.x3d.sai.Core.X3DMetadataObject instance (using a properly typed node) to inputOutput SFNode field metadata.
-
Method Details
-
getActionKeyPress
int getActionKeyPress()Provide int value from outputOnly SFInt32 field named actionKeyPress.
Tooltip: action key press gives following values: HOME=000 END=1001 PGUP=1002 PGDN=1003 UP=1004 DOWN=1005 LEFT=1006 RIGHT=1007 F1..F12 = 1008..1019.- Warning: it is an error to define this transient outputOnly field in an X3D file, instead only use it a source for ROUTE events.
- Returns:
- value of actionKeyPress field
-
getActionKeyRelease
int getActionKeyRelease()Provide int value from outputOnly SFInt32 field named actionKeyRelease.
Tooltip: action key release gives following values: HOME=000 END=1001 PGUP=1002 PGDN=1003 UP=1004 DOWN=1005 LEFT=1006 RIGHT=1007 F1..F12 = 1008..1019.- Warning: it is an error to define this transient outputOnly field in an X3D file, instead only use it a source for ROUTE events.
- Returns:
- value of actionKeyRelease field
-
getAltKey
boolean getAltKey()Provide boolean value from outputOnly SFBool field named altKey.
Tooltip: altKey generates true event when pressed, false event when released.- Warning: it is an error to define this transient outputOnly field in an X3D file, instead only use it a source for ROUTE events.
- Returns:
- value of altKey field
-
getControlKey
boolean getControlKey()Provide boolean value from outputOnly SFBool field named controlKey.
Tooltip: controlKey generates true event when pressed, false event when released.- Warning: it is an error to define this transient outputOnly field in an X3D file, instead only use it a source for ROUTE events.
- Returns:
- value of controlKey field
-
getDescription
String getDescription()Provide String value from inputOutput SFString field named description.
Tooltip: Author-provided prose that describes intended purpose of the node.- Hint: many XML tools substitute XML character references for special characters automatically if needed within an attribute value (such as & for & ampersand character, or " for " quotation-mark character).
- Specified by:
getDescriptionin interfaceX3DKeyDeviceSensorNode- Specified by:
getDescriptionin interfaceX3DSensorNode- Returns:
- value of description field
-
setDescription
Accessor method to assign String value to inputOutput SFString field named description.
Tooltip: Author-provided prose that describes intended purpose of the node.- Hint: many XML tools substitute XML character references for special characters automatically if needed within an attribute value (such as & for & ampersand character, or " for " quotation-mark character).
- Specified by:
setDescriptionin interfaceX3DKeyDeviceSensorNode- Specified by:
setDescriptionin interfaceX3DSensorNode- Parameters:
newValue- is new value for the description field.- Returns:
KeySensor- namely this same object to allow sequential method pipelining (i.e. consecutive method invocations on the same object).
-
getEnabled
boolean getEnabled()Provide boolean value from inputOutput SFBool field named enabled.
Tooltip: Enables/disables node operation. *- Specified by:
getEnabledin interfaceX3DKeyDeviceSensorNode- Specified by:
getEnabledin interfaceX3DSensorNode- Returns:
- value of enabled field
-
setEnabled
Accessor method to assign boolean value to inputOutput SFBool field named enabled.
Tooltip: Enables/disables node operation. *- Specified by:
setEnabledin interfaceX3DKeyDeviceSensorNode- Specified by:
setEnabledin interfaceX3DSensorNode- Parameters:
newValue- is new value for the enabled field.- Returns:
KeySensor- namely this same object to allow sequential method pipelining (i.e. consecutive method invocations on the same object).
-
getIsActive
boolean getIsActive()Provide boolean value from outputOnly SFBool field named isActive.
Tooltip: Select geometry by activating the pointing device (for example, clicking the mouse) to generate isActive events. Output event isActive=true is sent when geometry is selected (for example, when primary mouse button is pressed), output event isActive=false is sent when geometry is deselected (for example, when primary mouse button is released).- Warning: it is an error to define this transient outputOnly field in an X3D file, instead only use it a source for ROUTE events.
- Specified by:
getIsActivein interfaceX3DKeyDeviceSensorNode- Specified by:
getIsActivein interfaceX3DSensorNode- Returns:
- value of isActive field
-
getKeyPress
String getKeyPress()Provide String value from outputOnly SFString field named keyPress.
Tooltip: Events generated when user presses character-producing keys on keyboard produces integer UTF-8 character values.- Warning: it is an error to define this transient outputOnly field in an X3D file, instead only use it a source for ROUTE events.
- Returns:
- value of keyPress field
-
getKeyRelease
String getKeyRelease()Provide String value from outputOnly SFString field named keyRelease.
Tooltip: Events generated when user releases character-producing keys on keyboard produces integer UTF-8 character values.- Warning: it is an error to define this transient outputOnly field in an X3D file, instead only use it a source for ROUTE events.
- Returns:
- value of keyRelease field
-
getMetadata
X3DMetadataObject getMetadata()Provide org.web3d.x3d.sai.Core.X3DMetadataObject instance (using a properly typed node) from inputOutput SFNode field metadata.
Tooltip: [X3DMetadataObject] Information about this node can be contained in a MetadataBoolean, MetadataDouble, MetadataFloat, MetadataInteger, MetadataString or MetadataSet node.- Hint: X3D Architecture 7.2.4 Metadata https://www.web3d.org/specifications/X3Dv4/ISO-IEC19775-1v4-IS/Part01/components/core.html#Metadata
- Specified by:
getMetadatain interfaceX3DChildNode- Specified by:
getMetadatain interfaceX3DKeyDeviceSensorNode- Specified by:
getMetadatain interfaceX3DNode- Specified by:
getMetadatain interfaceX3DSensorNode- Returns:
- value of metadata field
- See Also:
-
setMetadata
Accessor method to assign org.web3d.x3d.sai.Core.X3DMetadataObject instance (using a properly typed node) to inputOutput SFNode field metadata.
Tooltip: [X3DMetadataObject] Information about this node can be contained in a MetadataBoolean, MetadataDouble, MetadataFloat, MetadataInteger, MetadataString or MetadataSet node.- Hint: X3D Architecture 7.2.4 Metadata https://www.web3d.org/specifications/X3Dv4/ISO-IEC19775-1v4-IS/Part01/components/core.html#Metadata
- Specified by:
setMetadatain interfaceX3DChildNode- Specified by:
setMetadatain interfaceX3DKeyDeviceSensorNode- Specified by:
setMetadatain interfaceX3DNode- Specified by:
setMetadatain interfaceX3DSensorNode- Parameters:
newValue- is new value for the metadata field.- Returns:
KeySensor- namely this same object to allow sequential method pipelining (i.e. consecutive method invocations on the same object).- See Also:
-
getShiftKey
boolean getShiftKey()Provide boolean value from outputOnly SFBool field named shiftKey.
Tooltip: shiftKey generates true event when pressed, false event when released.- Warning: it is an error to define this transient outputOnly field in an X3D file, instead only use it a source for ROUTE events.
- Returns:
- value of shiftKey field
-