Titania X3D Editor

It starts with you!

Titania v3.0.4

It starts with you!

X3D Reference

KeySensor

KeySensor

KeySensor generates events as the user presses keys on the keyboard. Supports notion of "keyboard focus".

The KeySensor node belongs to the KeyDeviceSensor component and its container field is children. It is available since X3D version 3.0 or later.

Hierarchy

Fields

SFNode [in, out] metadata NULL [X3DMetadataObject]

Metadata are not part of the X3D world and not interpreted by the X3D browser, but they can be accessed via the ECMAScript interface.

SFBool [in, out] enabled TRUE

Enables/disables node operation.

SFBool [out] controlKey

ControlKey generates true event when pressed, false event when released.

SFBool [out] shiftKey

ShiftKey generates true event when pressed, false event when released.

SFBool [out] altKey

AltKey generates true event when pressed, false event when released.

SFInt32 [out] actionKeyPress

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.

SFInt32 [out] actionKeyRelease

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.

SFString [out] keyPress

Events generated when user presses character-producing keys on keyboard produces integer UTF-8 character values.

SFString [out] keyRelease

Events generated when user releases character-producing keys on keyboard produces integer UTF-8 character values.

SFBool [out] isActive

Select geometry by activating the pointing device (e.g. clicking the mouse) to generate isActive events. Output event isActive=true is sent when geometry is selected (e.g. when primary mouse button is pressed), output event isActive=false is sent when geometry is deselected (e.g. when primary mouse button is released).

Browser Compatibility

Titania X_ITE
yes yes

External Links